From 40f32e89607d66dc6b871bc0b558e32981a4dd3d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 27 Feb 2025 00:49:14 +0000 Subject: [PATCH] CodeGen from PR 32875 in Azure/azure-rest-api-specs Merge 7c8d3ba9d79a5719a764866d9519ce3c69422b76 into 2d73bd7fb1c68a8b6829fac1760bd0fc84ca5554 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../README.md | 102 + .../SAMPLE.md | 3360 +++++++++++++++++ .../pom.xml | 63 + .../cdn/generated/CdnManager.java | 618 +++ .../fluent/AfdCustomDomainsClient.java | 361 ++ .../generated/fluent/AfdEndpointsClient.java | 460 +++ .../fluent/AfdOriginGroupsClient.java | 325 ++ .../generated/fluent/AfdOriginsClient.java | 306 ++ .../generated/fluent/AfdProfilesClient.java | 224 ++ .../generated/fluent/CdnManagementClient.java | 202 + .../generated/fluent/CustomDomainsClient.java | 372 ++ .../cdn/generated/fluent/EdgeNodesClient.java | 38 + .../cdn/generated/fluent/EndpointsClient.java | 635 ++++ .../generated/fluent/LogAnalyticsClient.java | 277 ++ .../fluent/ManagedRuleSetsClient.java | 40 + .../generated/fluent/OperationsClient.java | 38 + .../generated/fluent/OriginGroupsClient.java | 294 ++ .../cdn/generated/fluent/OriginsClient.java | 284 ++ .../cdn/generated/fluent/PoliciesClient.java | 233 ++ .../cdn/generated/fluent/ProfilesClient.java | 766 ++++ .../fluent/ResourceProvidersClient.java | 140 + .../fluent/ResourceUsagesClient.java | 38 + .../cdn/generated/fluent/RoutesClient.java | 320 ++ .../cdn/generated/fluent/RuleSetsClient.java | 215 ++ .../cdn/generated/fluent/RulesClient.java | 303 ++ .../cdn/generated/fluent/SecretsClient.java | 212 ++ .../fluent/SecurityPoliciesClient.java | 284 ++ .../fluent/models/AfdDomainInner.java | 329 ++ .../fluent/models/AfdDomainProperties.java | 273 ++ .../AfdDomainUpdatePropertiesParameters.java | 198 + .../fluent/models/AfdEndpointInner.java | 272 ++ .../fluent/models/AfdEndpointProperties.java | 182 + ...AfdEndpointPropertiesUpdateParameters.java | 123 + .../fluent/models/AfdOriginGroupInner.java | 293 ++ .../models/AfdOriginGroupProperties.java | 183 + ...OriginGroupUpdatePropertiesParameters.java | 234 ++ .../fluent/models/AfdOriginInner.java | 434 +++ .../fluent/models/AfdOriginProperties.java | 249 ++ .../AfdOriginUpdatePropertiesParameters.java | 407 ++ .../fluent/models/CanMigrateProperties.java | 132 + .../fluent/models/CanMigrateResultInner.java | 161 + .../CdnWebApplicationFirewallPolicyInner.java | 404 ++ ...ebApplicationFirewallPolicyProperties.java | 290 ++ ...ckEndpointNameAvailabilityOutputInner.java | 134 + .../CheckNameAvailabilityOutputInner.java | 115 + .../models/ContinentsResponseInner.java | 135 + .../fluent/models/CustomDomainInner.java | 269 ++ .../fluent/models/CustomDomainProperties.java | 240 ++ .../CustomDomainPropertiesParameters.java | 103 + .../DeepCreatedCustomDomainProperties.java | 136 + .../DeepCreatedOriginGroupProperties.java | 219 ++ .../models/DeepCreatedOriginProperties.java | 423 +++ .../fluent/models/EdgeNodeInner.java | 179 + .../fluent/models/EdgeNodeProperties.java | 109 + .../fluent/models/EndpointInner.java | 634 ++++ .../fluent/models/EndpointProperties.java | 417 ++ .../EndpointPropertiesUpdateParameters.java | 544 +++ .../models/ManagedRuleSetDefinitionInner.java | 228 ++ .../ManagedRuleSetDefinitionProperties.java | 137 + .../fluent/models/MetricsResponseInner.java | 192 + .../fluent/models/MigrateResultInner.java | 127 + .../models/MigrateResultProperties.java | 85 + .../fluent/models/OperationInner.java | 201 + .../fluent/models/OperationProperties.java | 97 + .../fluent/models/OriginGroupInner.java | 287 ++ .../fluent/models/OriginGroupProperties.java | 170 + ...OriginGroupUpdatePropertiesParameters.java | 211 ++ .../generated/fluent/models/OriginInner.java | 458 +++ .../fluent/models/OriginProperties.java | 250 ++ .../OriginUpdatePropertiesParameters.java | 399 ++ .../generated/fluent/models/ProfileInner.java | 357 ++ .../fluent/models/ProfileProperties.java | 197 + .../ProfilePropertiesUpdateParameters.java | 130 + .../fluent/models/RankingsResponseInner.java | 163 + .../fluent/models/ResourceUsageInner.java | 130 + .../fluent/models/ResourcesResponseInner.java | 134 + .../generated/fluent/models/RouteInner.java | 451 +++ .../fluent/models/RouteProperties.java | 281 ++ .../RouteUpdatePropertiesParameters.java | 445 +++ .../generated/fluent/models/RuleInner.java | 285 ++ .../fluent/models/RuleProperties.java | 180 + .../generated/fluent/models/RuleSetInner.java | 183 + .../fluent/models/RuleSetProperties.java | 119 + .../RuleUpdatePropertiesParameters.java | 230 ++ .../generated/fluent/models/SecretInner.java | 207 + .../fluent/models/SecretProperties.java | 151 + .../fluent/models/SecurityPolicyInner.java | 207 + .../models/SecurityPolicyProperties.java | 153 + .../SecurityPolicyUpdateProperties.java | 99 + .../generated/fluent/models/SsoUriInner.java | 81 + ...ortedOptimizationTypesListResultInner.java | 88 + .../generated/fluent/models/UsageInner.java | 209 + .../ValidateCustomDomainOutputInner.java | 115 + .../models/ValidateProbeOutputInner.java | 113 + .../models/ValidateSecretOutputInner.java | 122 + .../models/WafMetricsResponseInner.java | 193 + .../models/WafRankingsResponseInner.java | 192 + .../generated/fluent/models/package-info.java | 9 + .../cdn/generated/fluent/package-info.java | 9 + .../AfdCustomDomainsClientImpl.java | 1522 ++++++++ .../implementation/AfdCustomDomainsImpl.java | 166 + .../implementation/AfdDomainImpl.java | 229 ++ .../implementation/AfdEndpointImpl.java | 248 ++ .../AfdEndpointsClientImpl.java | 2005 ++++++++++ .../implementation/AfdEndpointsImpl.java | 210 ++ .../implementation/AfdOriginGroupImpl.java | 215 ++ .../AfdOriginGroupsClientImpl.java | 1498 ++++++++ .../implementation/AfdOriginGroupsImpl.java | 173 + .../implementation/AfdOriginImpl.java | 288 ++ .../implementation/AfdOriginsClientImpl.java | 1342 +++++++ .../implementation/AfdOriginsImpl.java | 182 + .../implementation/AfdProfilesClientImpl.java | 1035 +++++ .../implementation/AfdProfilesImpl.java | 153 + .../implementation/CanMigrateResultImpl.java | 57 + .../CdnManagementClientBuilder.java | 138 + .../CdnManagementClientImpl.java | 624 +++ .../CdnWebApplicationFirewallPolicyImpl.java | 265 ++ ...eckEndpointNameAvailabilityOutputImpl.java | 44 + .../CheckNameAvailabilityOutputImpl.java | 40 + .../ContinentsResponseImpl.java | 50 + .../implementation/CustomDomainImpl.java | 160 + .../CustomDomainsClientImpl.java | 1647 ++++++++ .../implementation/CustomDomainsImpl.java | 243 ++ .../implementation/EdgeNodeImpl.java | 56 + .../implementation/EdgeNodesClientImpl.java | 231 ++ .../implementation/EdgeNodesImpl.java | 45 + .../implementation/EndpointImpl.java | 504 +++ .../implementation/EndpointsClientImpl.java | 2701 +++++++++++++ .../implementation/EndpointsImpl.java | 258 ++ .../LogAnalyticsClientImpl.java | 1312 +++++++ .../implementation/LogAnalyticsImpl.java | 211 ++ .../ManagedRuleSetDefinitionImpl.java | 74 + .../ManagedRuleSetsClientImpl.java | 248 ++ .../implementation/ManagedRuleSetsImpl.java | 45 + .../implementation/MetricsResponseImpl.java | 54 + .../implementation/MigrateResultImpl.java | 41 + .../implementation/OperationImpl.java | 49 + .../implementation/OperationsClientImpl.java | 231 ++ .../implementation/OperationsImpl.java | 45 + .../implementation/OriginGroupImpl.java | 214 ++ .../OriginGroupsClientImpl.java | 1309 +++++++ .../implementation/OriginGroupsImpl.java | 183 + .../generated/implementation/OriginImpl.java | 300 ++ .../implementation/OriginsClientImpl.java | 1268 +++++++ .../generated/implementation/OriginsImpl.java | 179 + .../implementation/PoliciesClientImpl.java | 1059 ++++++ .../implementation/PoliciesImpl.java | 142 + .../generated/implementation/ProfileImpl.java | 312 ++ .../implementation/ProfilesClientImpl.java | 3272 ++++++++++++++++ .../implementation/ProfilesImpl.java | 307 ++ .../implementation/RankingsResponseImpl.java | 49 + .../implementation/ResourceManagerUtils.java | 195 + .../ResourceProvidersClientImpl.java | 593 +++ .../implementation/ResourceProvidersImpl.java | 132 + .../implementation/ResourceUsageImpl.java | 45 + .../ResourceUsagesClientImpl.java | 243 ++ .../implementation/ResourceUsagesImpl.java | 45 + .../implementation/ResourcesResponseImpl.java | 50 + .../generated/implementation/RouteImpl.java | 328 ++ .../implementation/RoutesClientImpl.java | 1358 +++++++ .../generated/implementation/RoutesImpl.java | 179 + .../generated/implementation/RuleImpl.java | 215 ++ .../generated/implementation/RuleSetImpl.java | 58 + .../implementation/RuleSetsClientImpl.java | 1076 ++++++ .../implementation/RuleSetsImpl.java | 111 + .../implementation/RulesClientImpl.java | 1315 +++++++ .../generated/implementation/RulesImpl.java | 179 + .../generated/implementation/SecretImpl.java | 117 + .../implementation/SecretsClientImpl.java | 946 +++++ .../generated/implementation/SecretsImpl.java | 155 + .../SecurityPoliciesClientImpl.java | 1248 ++++++ .../implementation/SecurityPoliciesImpl.java | 157 + .../implementation/SecurityPolicyImpl.java | 157 + .../generated/implementation/SsoUriImpl.java | 31 + ...portedOptimizationTypesListResultImpl.java | 40 + .../generated/implementation/UsageImpl.java | 49 + .../ValidateCustomDomainOutputImpl.java | 40 + .../ValidateProbeOutputImpl.java | 40 + .../ValidateSecretOutputImpl.java | 37 + .../WafMetricsResponseImpl.java | 54 + .../WafRankingsResponseImpl.java | 58 + .../implementation/package-info.java | 9 + .../cdn/generated/models/ActionType.java | 61 + .../models/ActivatedResourceReference.java | 109 + .../generated/models/AfdCertificateType.java | 57 + .../generated/models/AfdCustomDomains.java | 189 + .../cdn/generated/models/AfdDomain.java | 369 ++ .../models/AfdDomainHttpsParameters.java | 165 + .../generated/models/AfdDomainListResult.java | 116 + .../models/AfdDomainUpdateParameters.java | 172 + .../cdn/generated/models/AfdEndpoint.java | 394 ++ .../models/AfdEndpointListResult.java | 116 + .../models/AfdEndpointProtocols.java | 51 + .../models/AfdEndpointUpdateParameters.java | 149 + .../cdn/generated/models/AfdEndpoints.java | 259 ++ .../models/AfdMinimumTlsVersion.java | 56 + .../cdn/generated/models/AfdOrigin.java | 559 +++ .../cdn/generated/models/AfdOriginGroup.java | 359 ++ .../models/AfdOriginGroupListResult.java | 117 + .../AfdOriginGroupUpdateParameters.java | 204 + .../cdn/generated/models/AfdOriginGroups.java | 180 + .../generated/models/AfdOriginListResult.java | 116 + .../models/AfdOriginUpdateParameters.java | 343 ++ .../cdn/generated/models/AfdOrigins.java | 158 + .../cdn/generated/models/AfdProfiles.java | 164 + .../models/AfdProvisioningState.java | 66 + .../generated/models/AfdPurgeParameters.java | 135 + .../models/AfdQueryStringCachingBehavior.java | 64 + .../models/AfdRouteCacheConfiguration.java | 160 + .../generated/models/AfdStateProperties.java | 120 + .../cdn/generated/models/Algorithm.java | 46 + .../AutoGeneratedDomainNameLabelScope.java | 61 + .../AzureFirstPartyManagedCertificate.java | 112 + ...irstPartyManagedCertificateParameters.java | 207 + .../cdn/generated/models/CacheBehavior.java | 56 + .../generated/models/CacheConfiguration.java | 223 ++ .../CacheExpirationActionParameters.java | 187 + .../CacheKeyQueryStringActionParameters.java | 153 + .../cdn/generated/models/CacheType.java | 46 + .../models/CanMigrateDefaultSku.java | 51 + .../models/CanMigrateParameters.java | 106 + .../generated/models/CanMigrateResult.java | 55 + .../CdnCertificateSourceParameters.java | 125 + .../cdn/generated/models/CdnEndpoint.java | 93 + .../models/CdnManagedHttpsParameters.java | 159 + .../models/CdnMigrationToAfdParameters.java | 142 + .../CdnWebApplicationFirewallPolicy.java | 404 ++ .../CdnWebApplicationFirewallPolicyList.java | 119 + ...licationFirewallPolicyPatchParameters.java | 97 + .../cdn/generated/models/Certificate.java | 147 + .../generated/models/CertificateSource.java | 51 + .../models/CertificateSourceParameters.java | 111 + .../CertificateSourceParametersType.java | 53 + .../cdn/generated/models/CertificateType.java | 51 + .../CheckEndpointNameAvailabilityInput.java | 169 + .../CheckEndpointNameAvailabilityOutput.java | 49 + .../CheckHostnameAvailabilityInput.java | 103 + .../models/CheckNameAvailabilityInput.java | 135 + .../models/CheckNameAvailabilityOutput.java | 40 + .../cdn/generated/models/CidrIpAddress.java | 121 + .../ClientPortMatchConditionParameters.java | 213 ++ .../generated/models/ClientPortOperator.java | 91 + .../generated/models/CompressionSettings.java | 134 + .../generated/models/ContinentsResponse.java | 34 + .../ContinentsResponseContinentsItem.java | 94 + ...ontinentsResponseCountryOrRegionsItem.java | 123 + .../CookiesMatchConditionParameters.java | 241 ++ .../cdn/generated/models/CookiesOperator.java | 91 + .../cdn/generated/models/CustomDomain.java | 230 ++ .../models/CustomDomainHttpsParameters.java | 178 + .../models/CustomDomainListResult.java | 116 + .../models/CustomDomainParameters.java | 110 + .../models/CustomDomainResourceState.java | 56 + .../cdn/generated/models/CustomDomains.java | 225 ++ .../models/CustomHttpsProvisioningState.java | 66 + .../CustomHttpsProvisioningSubstate.java | 96 + .../cdn/generated/models/CustomRule.java | 229 ++ .../models/CustomRuleEnabledState.java | 51 + .../cdn/generated/models/CustomRuleList.java | 98 + .../generated/models/CustomerCertificate.java | 267 ++ .../models/CustomerCertificateParameters.java | 281 ++ .../models/DeepCreatedCustomDomain.java | 173 + .../generated/models/DeepCreatedOrigin.java | 402 ++ .../models/DeepCreatedOriginGroup.java | 234 ++ .../cdn/generated/models/DeleteRule.java | 46 + .../cdn/generated/models/DeliveryRule.java | 201 + .../generated/models/DeliveryRuleAction.java | 123 + .../models/DeliveryRuleActionParameters.java | 123 + .../DeliveryRuleActionParametersType.java | 89 + .../models/DeliveryRuleActionValue.java | 86 + .../DeliveryRuleCacheExpirationAction.java | 125 + ...DeliveryRuleCacheKeyQueryStringAction.java | 125 + .../DeliveryRuleClientPortCondition.java | 124 + .../models/DeliveryRuleCondition.java | 143 + .../DeliveryRuleConditionParameters.java | 146 + .../DeliveryRuleConditionParametersType.java | 156 + .../models/DeliveryRuleCookiesCondition.java | 123 + .../models/DeliveryRuleHostnameCondition.java | 124 + .../DeliveryRuleHttpVersionCondition.java | 124 + .../models/DeliveryRuleIsDeviceCondition.java | 124 + .../models/DeliveryRulePostArgsCondition.java | 124 + .../DeliveryRuleQueryStringCondition.java | 124 + .../DeliveryRuleRemoteAddressCondition.java | 124 + .../DeliveryRuleRequestBodyCondition.java | 124 + .../DeliveryRuleRequestHeaderAction.java | 124 + .../DeliveryRuleRequestHeaderCondition.java | 124 + .../DeliveryRuleRequestMethodCondition.java | 124 + .../DeliveryRuleRequestSchemeCondition.java | 124 + .../DeliveryRuleRequestUriCondition.java | 124 + .../DeliveryRuleResponseHeaderAction.java | 124 + ...yRuleRouteConfigurationOverrideAction.java | 127 + .../DeliveryRuleServerPortCondition.java | 124 + .../DeliveryRuleSocketAddrCondition.java | 124 + .../DeliveryRuleSslProtocolCondition.java | 124 + ...DeliveryRuleUrlFileExtensionCondition.java | 125 + .../DeliveryRuleUrlFileNameCondition.java | 124 + .../models/DeliveryRuleUrlPathCondition.java | 123 + .../generated/models/DeploymentStatus.java | 61 + .../generated/models/DestinationProtocol.java | 56 + .../generated/models/DimensionProperties.java | 149 + .../models/DomainValidationProperties.java | 97 + .../models/DomainValidationState.java | 87 + .../cdn/generated/models/EdgeNode.java | 56 + .../cdn/generated/models/EdgeNodes.java | 33 + .../cdn/generated/models/EdgenodeResult.java | 116 + .../cdn/generated/models/EnabledState.java | 51 + .../cdn/generated/models/Endpoint.java | 1014 +++++ .../generated/models/EndpointListResult.java | 116 + ...pertiesUpdateParametersDeliveryPolicy.java | 136 + ...etersWebApplicationFirewallPolicyLink.java | 98 + .../models/EndpointProvisioningState.java | 66 + .../models/EndpointResourceState.java | 71 + .../models/EndpointUpdateParameters.java | 475 +++ .../cdn/generated/models/Endpoints.java | 337 ++ .../generated/models/ForwardingProtocol.java | 56 + .../cdn/generated/models/GeoFilter.java | 171 + .../generated/models/GeoFilterActions.java | 56 + .../cdn/generated/models/HeaderAction.java | 56 + .../models/HeaderActionParameters.java | 183 + .../models/HealthProbeParameters.java | 179 + .../models/HealthProbeRequestType.java | 61 + .../HostnameMatchConditionParameters.java | 213 ++ .../generated/models/HostnameOperator.java | 91 + .../models/HttpErrorRangeParameters.java | 121 + .../HttpVersionMatchConditionParameters.java | 213 ++ .../generated/models/HttpVersionOperator.java | 46 + .../cdn/generated/models/HttpsRedirect.java | 52 + .../cdn/generated/models/IpAddressGroup.java | 158 + .../IsDeviceMatchConditionParameters.java | 215 ++ .../generated/models/IsDeviceMatchValue.java | 51 + .../generated/models/IsDeviceOperator.java | 46 + .../KeyVaultCertificateSourceParameters.java | 322 ++ .../models/KeyVaultSigningKeyParameters.java | 268 ++ .../KeyVaultSigningKeyParametersType.java | 47 + .../generated/models/LinkToDefaultDomain.java | 51 + .../LoadBalancingSettingsParameters.java | 155 + .../cdn/generated/models/LoadParameters.java | 105 + .../cdn/generated/models/LogAnalytics.java | 243 ++ .../cdn/generated/models/LogMetric.java | 71 + .../models/LogMetricsGranularity.java | 56 + .../generated/models/LogMetricsGroupBy.java | 66 + .../cdn/generated/models/LogRanking.java | 66 + .../generated/models/LogRankingMetric.java | 71 + .../generated/models/LogSpecification.java | 177 + .../generated/models/ManagedCertificate.java | 111 + .../models/ManagedCertificateParameters.java | 115 + .../models/ManagedRuleDefinition.java | 97 + .../models/ManagedRuleEnabledState.java | 51 + .../models/ManagedRuleGroupDefinition.java | 119 + .../models/ManagedRuleGroupOverride.java | 138 + .../generated/models/ManagedRuleOverride.java | 160 + .../cdn/generated/models/ManagedRuleSet.java | 199 + .../models/ManagedRuleSetDefinition.java | 85 + .../models/ManagedRuleSetDefinitionList.java | 116 + .../generated/models/ManagedRuleSetList.java | 100 + .../cdn/generated/models/ManagedRuleSets.java | 35 + .../models/ManagedServiceIdentity.java | 190 + .../models/ManagedServiceIdentityType.java | 62 + .../cdn/generated/models/MatchCondition.java | 256 ++ .../models/MatchProcessingBehavior.java | 52 + .../cdn/generated/models/MatchVariable.java | 136 + .../generated/models/MetricAvailability.java | 121 + .../generated/models/MetricSpecification.java | 389 ++ .../generated/models/MetricsGranularity.java | 56 + .../cdn/generated/models/MetricsResponse.java | 49 + .../models/MetricsResponseSeriesItem.java | 188 + .../models/MetricsResponseSeriesItemData.java | 127 + ...ricsResponseSeriesPropertiesItemsItem.java | 123 + .../generated/models/MetricsSeriesUnit.java | 61 + .../cdn/generated/models/MigrateResult.java | 40 + .../models/MigrationEndpointMapping.java | 124 + .../generated/models/MigrationErrorType.java | 130 + .../generated/models/MigrationParameters.java | 210 ++ ...igrationWebApplicationFirewallMapping.java | 130 + .../generated/models/MinimumTlsVersion.java | 61 + .../cdn/generated/models/Operation.java | 54 + .../generated/models/OperationDisplay.java | 129 + .../cdn/generated/models/Operations.java | 33 + .../models/OperationsListResult.java | 128 + .../cdn/generated/models/Operator.java | 101 + .../generated/models/OptimizationType.java | 67 + .../cdn/generated/models/Origin.java | 598 +++ .../cdn/generated/models/OriginGroup.java | 338 ++ .../models/OriginGroupListResult.java | 116 + .../generated/models/OriginGroupOverride.java | 126 + .../models/OriginGroupOverrideAction.java | 123 + .../OriginGroupOverrideActionParameters.java | 125 + .../models/OriginGroupProvisioningState.java | 66 + .../models/OriginGroupResourceState.java | 56 + .../models/OriginGroupUpdateParameters.java | 197 + .../cdn/generated/models/OriginGroups.java | 152 + .../generated/models/OriginListResult.java | 116 + .../models/OriginProvisioningState.java | 66 + .../generated/models/OriginResourceState.java | 56 + .../models/OriginUpdateParameters.java | 360 ++ .../cdn/generated/models/Origins.java | 151 + .../cdn/generated/models/ParamIndicator.java | 56 + .../cdn/generated/models/Policies.java | 142 + .../generated/models/PolicyEnabledState.java | 51 + .../cdn/generated/models/PolicyMode.java | 51 + .../generated/models/PolicyResourceState.java | 71 + .../cdn/generated/models/PolicySettings.java | 217 ++ ...sDefaultCustomBlockResponseStatusCode.java | 139 + .../PostArgsMatchConditionParameters.java | 241 ++ .../generated/models/PostArgsOperator.java | 91 + .../models/PrivateEndpointStatus.java | 66 + .../cdn/generated/models/ProbeProtocol.java | 61 + .../cdn/generated/models/Profile.java | 553 +++ .../models/ProfileChangeSkuWafMapping.java | 137 + .../generated/models/ProfileListResult.java | 116 + .../generated/models/ProfileLogScrubbing.java | 128 + .../models/ProfileProvisioningState.java | 66 + .../models/ProfileResourceState.java | 86 + .../models/ProfileScrubbingRules.java | 200 + .../models/ProfileScrubbingState.java | 51 + .../models/ProfileUpdateParameters.java | 196 + .../models/ProfileUpgradeParameters.java | 110 + .../cdn/generated/models/Profiles.java | 427 +++ .../cdn/generated/models/ProtocolType.java | 51 + .../generated/models/ProvisioningState.java | 56 + .../cdn/generated/models/PurgeParameters.java | 105 + .../generated/models/QueryStringBehavior.java | 61 + .../models/QueryStringCachingBehavior.java | 67 + .../QueryStringMatchConditionParameters.java | 213 ++ .../generated/models/QueryStringOperator.java | 91 + .../generated/models/RankingsResponse.java | 42 + .../models/RankingsResponseTablesItem.java | 127 + ...ingsResponseTablesPropertiesItemsItem.java | 130 + ...ponseTablesPropertiesItemsMetricsItem.java | 153 + .../cdn/generated/models/RateLimitRule.java | 203 + .../generated/models/RateLimitRuleList.java | 98 + .../cdn/generated/models/RedirectType.java | 61 + ...RemoteAddressMatchConditionParameters.java | 218 ++ .../models/RemoteAddressOperator.java | 56 + .../RequestBodyMatchConditionParameters.java | 213 ++ .../generated/models/RequestBodyOperator.java | 91 + ...RequestHeaderMatchConditionParameters.java | 241 ++ .../models/RequestHeaderOperator.java | 91 + ...RequestMethodMatchConditionParameters.java | 215 ++ .../models/RequestMethodMatchValue.java | 76 + .../models/RequestMethodOperator.java | 46 + ...RequestSchemeMatchConditionParameters.java | 193 + .../models/RequestSchemeMatchValue.java | 51 + .../RequestUriMatchConditionParameters.java | 213 ++ .../generated/models/RequestUriOperator.java | 91 + .../generated/models/ResourceProviders.java | 122 + .../generated/models/ResourceReference.java | 93 + .../cdn/generated/models/ResourceType.java | 52 + .../cdn/generated/models/ResourceUsage.java | 47 + .../models/ResourceUsageListResult.java | 115 + .../generated/models/ResourceUsageUnit.java | 46 + .../cdn/generated/models/ResourceUsages.java | 33 + .../generated/models/ResourcesResponse.java | 34 + .../ResourcesResponseCustomDomainsItem.java | 178 + .../ResourcesResponseEndpointsItem.java | 185 + ...sResponseEndpointsPropertiesItemsItem.java | 180 + .../ResponseBasedDetectedErrorTypes.java | 61 + ...seBasedOriginErrorDetectionParameters.java | 172 + .../cdn/generated/models/Route.java | 571 +++ ...ConfigurationOverrideActionParameters.java | 155 + .../cdn/generated/models/RouteListResult.java | 116 + .../models/RouteUpdateParameters.java | 356 ++ .../cdn/generated/models/Routes.java | 169 + .../cdn/generated/models/Rule.java | 335 ++ .../generated/models/RuleCacheBehavior.java | 56 + .../models/RuleIsCompressionEnabled.java | 53 + .../cdn/generated/models/RuleListResult.java | 116 + .../RuleQueryStringCachingBehavior.java | 64 + .../cdn/generated/models/RuleSet.java | 69 + .../generated/models/RuleSetListResult.java | 116 + .../cdn/generated/models/RuleSets.java | 165 + .../models/RuleUpdateParameters.java | 194 + .../cdn/generated/models/Rules.java | 157 + .../ScrubbingRuleEntryMatchOperator.java | 47 + .../ScrubbingRuleEntryMatchVariable.java | 56 + .../models/ScrubbingRuleEntryState.java | 51 + .../cdn/generated/models/Secret.java | 159 + .../generated/models/SecretListResult.java | 116 + .../generated/models/SecretParameters.java | 113 + .../cdn/generated/models/SecretType.java | 62 + .../cdn/generated/models/Secrets.java | 149 + .../generated/models/SecurityPolicies.java | 150 + .../cdn/generated/models/SecurityPolicy.java | 211 ++ .../models/SecurityPolicyListResult.java | 117 + .../SecurityPolicyPropertiesParameters.java | 109 + .../generated/models/SecurityPolicyType.java | 46 + .../SecurityPolicyUpdateParameters.java | 111 + ...licyWebApplicationFirewallAssociation.java | 131 + ...olicyWebApplicationFirewallParameters.java | 152 + .../ServerPortMatchConditionParameters.java | 213 ++ .../generated/models/ServerPortOperator.java | 91 + .../models/ServiceSpecification.java | 134 + .../SharedPrivateLinkResourceProperties.java | 213 ++ .../SharedPrivateLinkResourceStatus.java | 71 + .../cdn/generated/models/Sku.java | 110 + .../cdn/generated/models/SkuName.java | 108 + .../SocketAddrMatchConditionParameters.java | 213 ++ .../generated/models/SocketAddrOperator.java | 51 + .../cdn/generated/models/SslProtocol.java | 56 + .../SslProtocolMatchConditionParameters.java | 215 ++ .../generated/models/SslProtocolOperator.java | 46 + .../cdn/generated/models/SsoUri.java | 26 + .../cdn/generated/models/Status.java | 61 + .../SupportedOptimizationTypesListResult.java | 28 + .../cdn/generated/models/Transform.java | 71 + .../cdn/generated/models/TransformType.java | 71 + .../cdn/generated/models/UpdateRule.java | 46 + ...FileExtensionMatchConditionParameters.java | 213 ++ .../models/UrlFileExtensionOperator.java | 91 + .../UrlFileNameMatchConditionParameters.java | 213 ++ .../generated/models/UrlFileNameOperator.java | 91 + .../UrlPathMatchConditionParameters.java | 213 ++ .../cdn/generated/models/UrlPathOperator.java | 96 + .../generated/models/UrlRedirectAction.java | 121 + .../models/UrlRedirectActionParameters.java | 275 ++ .../generated/models/UrlRewriteAction.java | 121 + .../models/UrlRewriteActionParameters.java | 187 + .../generated/models/UrlSigningAction.java | 121 + .../models/UrlSigningActionParameters.java | 150 + .../cdn/generated/models/UrlSigningKey.java | 139 + .../models/UrlSigningKeyParameters.java | 196 + .../models/UrlSigningParamIdentifier.java | 137 + .../cdn/generated/models/Usage.java | 54 + .../cdn/generated/models/UsageName.java | 121 + .../cdn/generated/models/UsageUnit.java | 46 + .../generated/models/UsagesListResult.java | 127 + .../models/UserAssignedIdentity.java | 100 + .../models/UserManagedHttpsParameters.java | 160 + .../models/ValidateCustomDomainInput.java | 102 + .../models/ValidateCustomDomainOutput.java | 40 + .../generated/models/ValidateProbeInput.java | 101 + .../generated/models/ValidateProbeOutput.java | 40 + .../generated/models/ValidateSecretInput.java | 170 + .../models/ValidateSecretOutput.java | 33 + .../cdn/generated/models/WafAction.java | 61 + .../cdn/generated/models/WafGranularity.java | 56 + .../generated/models/WafMatchVariable.java | 86 + .../cdn/generated/models/WafMetric.java | 46 + .../models/WafMetricsGranularity.java | 56 + .../generated/models/WafMetricsResponse.java | 49 + .../models/WafMetricsResponseSeriesItem.java | 188 + .../WafMetricsResponseSeriesItemData.java | 127 + ...ricsResponseSeriesPropertiesItemsItem.java | 123 + .../models/WafMetricsSeriesUnit.java | 46 + .../generated/models/WafRankingGroupBy.java | 51 + .../cdn/generated/models/WafRankingType.java | 81 + .../generated/models/WafRankingsResponse.java | 49 + .../models/WafRankingsResponseDataItem.java | 128 + .../WafRankingsResponseDataItemMetric.java | 151 + .../cdn/generated/models/WafRuleType.java | 56 + .../cdn/generated/models/package-info.java | 9 + .../cdn/generated/package-info.java | 9 + .../src/main/java/module-info.java | 15 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...e-resourcemanager-cdn-generated.properties | 1 + .../AfdCustomDomainsCreateSamples.java | 35 + .../AfdCustomDomainsDeleteSamples.java | 23 + .../generated/AfdCustomDomainsGetSamples.java | 23 + .../AfdCustomDomainsListByProfileSamples.java | 23 + ...mDomainsRefreshValidationTokenSamples.java | 24 + .../AfdCustomDomainsUpdateSamples.java | 36 + .../generated/AfdEndpointsCreateSamples.java | 27 + .../generated/AfdEndpointsDeleteSamples.java | 23 + .../generated/AfdEndpointsGetSamples.java | 23 + .../AfdEndpointsListByProfileSamples.java | 23 + .../AfdEndpointsListResourceUsageSamples.java | 23 + .../AfdEndpointsPurgeContentSamples.java | 30 + .../generated/AfdEndpointsUpdateSamples.java | 43 + ...dEndpointsValidateCustomDomainSamples.java | 28 + .../AfdOriginGroupsCreateSamples.java | 39 + .../AfdOriginGroupsDeleteSamples.java | 23 + .../generated/AfdOriginGroupsGetSamples.java | 23 + .../AfdOriginGroupsListByProfileSamples.java | 23 + ...dOriginGroupsListResourceUsageSamples.java | 24 + .../AfdOriginGroupsUpdateSamples.java | 41 + .../generated/AfdOriginsCreateSamples.java | 33 + .../generated/AfdOriginsDeleteSamples.java | 23 + .../generated/AfdOriginsGetSamples.java | 24 + .../AfdOriginsListByOriginGroupSamples.java | 23 + .../generated/AfdOriginsUpdateSamples.java | 34 + ...sCheckEndpointNameAvailabilitySamples.java | 32 + ...filesCheckHostnameAvailabilitySamples.java | 30 + .../AfdProfilesListResourceUsageSamples.java | 23 + .../generated/AfdProfilesUpgradeSamples.java | 34 + .../AfdProfilesValidateSecretSamples.java | 32 + .../generated/CustomDomainsCreateSamples.java | 27 + .../generated/CustomDomainsDeleteSamples.java | 24 + ...ustomDomainsDisableCustomHttpsSamples.java | 24 + ...CustomDomainsEnableCustomHttpsSamples.java | 42 + .../generated/CustomDomainsGetSamples.java | 24 + .../CustomDomainsListByEndpointSamples.java | 23 + .../generated/EdgeNodesListSamples.java | 23 + .../generated/EndpointsCreateSamples.java | 27 + .../generated/EndpointsDeleteSamples.java | 23 + .../generated/EndpointsGetSamples.java | 23 + .../EndpointsListByProfileSamples.java | 23 + .../EndpointsListResourceUsageSamples.java | 23 + .../EndpointsLoadContentSamples.java | 28 + .../EndpointsPurgeContentSamples.java | 28 + .../generated/EndpointsStartSamples.java | 23 + .../generated/EndpointsStopSamples.java | 23 + .../generated/EndpointsUpdateSamples.java | 42 + .../EndpointsValidateCustomDomainSamples.java | 27 + ...lyticsGetLogAnalyticsLocationsSamples.java | 25 + ...nalyticsGetLogAnalyticsMetricsSamples.java | 35 + ...alyticsGetLogAnalyticsRankingsSamples.java | 33 + ...lyticsGetLogAnalyticsResourcesSamples.java | 25 + ...yticsGetWafLogAnalyticsMetricsSamples.java | 34 + ...ticsGetWafLogAnalyticsRankingsSamples.java | 32 + .../generated/ManagedRuleSetsListSamples.java | 23 + .../generated/OperationsListSamples.java | 23 + .../generated/OriginGroupsCreateSamples.java | 43 + .../generated/OriginGroupsDeleteSamples.java | 23 + .../generated/OriginGroupsGetSamples.java | 24 + .../OriginGroupsListByEndpointSamples.java | 23 + .../generated/OriginGroupsUpdateSamples.java | 40 + .../generated/OriginsCreateSamples.java | 37 + .../generated/OriginsDeleteSamples.java | 23 + .../generated/OriginsGetSamples.java | 23 + .../OriginsListByEndpointSamples.java | 23 + .../generated/OriginsUpdateSamples.java | 36 + .../PoliciesCreateOrUpdateSamples.java | 98 + .../generated/PoliciesDeleteSamples.java | 23 + .../PoliciesGetByResourceGroupSamples.java | 23 + .../PoliciesListByResourceGroupSamples.java | 23 + .../generated/PoliciesUpdateSamples.java | 42 + .../generated/ProfilesCanMigrateSamples.java | 30 + .../ProfilesCdnCanMigrateToAfdSamples.java | 23 + .../ProfilesCdnMigrateToAfdSamples.java | 30 + .../generated/ProfilesCreateSamples.java | 31 + .../generated/ProfilesDeleteSamples.java | 23 + .../ProfilesGenerateSsoUriSamples.java | 23 + .../ProfilesGetByResourceGroupSamples.java | 22 + .../ProfilesListByResourceGroupSamples.java | 23 + .../ProfilesListResourceUsageSamples.java | 23 + .../generated/ProfilesListSamples.java | 23 + ...ListSupportedOptimizationTypesSamples.java | 25 + .../generated/ProfilesMigrateSamples.java | 34 + .../ProfilesMigrationAbortSamples.java | 23 + .../ProfilesMigrationCommitSamples.java | 23 + .../generated/ProfilesUpdateSamples.java | 42 + ...rCheckEndpointNameAvailabilitySamples.java | 32 + ...eProviderCheckNameAvailabilitySamples.java | 28 + ...meAvailabilityWithSubscriptionSamples.java | 30 + .../ResourceProviderValidateProbeSamples.java | 27 + .../generated/ResourceUsageListSamples.java | 23 + .../generated/RoutesCreateSamples.java | 56 + .../generated/RoutesDeleteSamples.java | 23 + .../generated/generated/RoutesGetSamples.java | 22 + .../RoutesListByEndpointSamples.java | 23 + .../generated/RoutesUpdateSamples.java | 57 + .../generated/RuleSetsCreateSamples.java | 23 + .../generated/RuleSetsDeleteSamples.java | 23 + .../generated/RuleSetsGetSamples.java | 22 + .../RuleSetsListByProfileSamples.java | 23 + .../RuleSetsListResourceUsageSamples.java | 23 + .../generated/RulesCreateSamples.java | 43 + .../generated/RulesDeleteSamples.java | 22 + .../generated/generated/RulesGetSamples.java | 22 + .../generated/RulesListByRuleSetSamples.java | 23 + .../generated/RulesUpdateSamples.java | 37 + .../generated/SecretsCreateSamples.java | 33 + .../generated/SecretsDeleteSamples.java | 23 + .../generated/SecretsGetSamples.java | 22 + .../SecretsListByProfileSamples.java | 23 + .../SecurityPoliciesCreateSamples.java | 41 + .../SecurityPoliciesDeleteSamples.java | 23 + .../generated/SecurityPoliciesGetSamples.java | 24 + .../SecurityPoliciesListByProfileSamples.java | 23 + .../SecurityPoliciesPatchSamples.java | 43 + sdk/cdn/ci.yml | 46 + sdk/cdn/pom.xml | 15 + 676 files changed, 115312 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/SAMPLE.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/models/AfdDomainInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainUpdatePropertiesParameters.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/AfdEndpointProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointPropertiesUpdateParameters.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/AfdOriginGroupProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupUpdatePropertiesParameters.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/AfdOriginProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginUpdatePropertiesParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateResultInner.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/CdnWebApplicationFirewallPolicyProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckEndpointNameAvailabilityOutputInner.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/CustomDomainProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainPropertiesParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedCustomDomainProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginGroupProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginProperties.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/EdgeNodeProperties.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/EndpointProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointPropertiesUpdateParameters.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/ManagedRuleSetDefinitionProperties.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/MigrateResultInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultProperties.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/OperationProperties.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/OriginGroupProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupUpdatePropertiesParameters.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/OriginProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginUpdatePropertiesParameters.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/ProfileProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfilePropertiesUpdateParameters.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/RouteProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteUpdatePropertiesParameters.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/RuleProperties.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/RuleSetProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleUpdatePropertiesParameters.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/SecretProperties.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/SecurityPolicyProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyUpdateProperties.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/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/CanMigrateResultImpl.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/CheckEndpointNameAvailabilityOutputImpl.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/MigrateResultImpl.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/ResourceManagerUtils.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/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/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/ActivatedResourceReference.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/AfdDomainUpdateParameters.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/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/AfdOriginGroupUpdateParameters.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/AfdOriginUpdateParameters.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/AfdRouteCacheConfiguration.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/AutoGeneratedDomainNameLabelScope.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificate.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificateParameters.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/CacheConfiguration.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/CanMigrateDefaultSku.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateResult.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/CdnMigrationToAfdParameters.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/CertificateSourceParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSourceParametersType.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/CheckEndpointNameAvailabilityInput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityOutput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckHostnameAvailabilityInput.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/ClientPortMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CompressionSettings.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/DeepCreatedCustomDomain.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/DeliveryRuleActionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionParametersType.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/DeliveryRuleClientPortCondition.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/DeliveryRuleConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleConditionParametersType.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/DeliveryRuleHostnameCondition.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/DeliveryRuleRouteConfigurationOverrideAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleServerPortCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSocketAddrCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSslProtocolCondition.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/DimensionProperties.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/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/EndpointProvisioningState.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/HostnameMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameOperator.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/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/IsDeviceMatchValue.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/KeyVaultSigningKeyParametersType.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/LogSpecification.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/ManagedServiceIdentity.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentityType.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/MetricAvailability.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricSpecification.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsGranularity.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/MetricsResponseSeriesItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemData.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/MetricsSeriesUnit.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrateResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationEndpointMapping.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationErrorType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationWebApplicationFirewallMapping.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/OriginGroupOverride.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/OriginGroupProvisioningState.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/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/OriginProvisioningState.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/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/ProfileChangeSkuWafMapping.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/ProfileLogScrubbing.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileProvisioningState.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/ProfileScrubbingRules.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileScrubbingState.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/ProfileUpgradeParameters.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/RequestMethodMatchValue.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/RequestSchemeMatchValue.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/ResourceType.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/ResourceUsageUnit.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/RouteConfigurationOverrideActionParameters.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/RouteUpdateParameters.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/RuleCacheBehavior.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleIsCompressionEnabled.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/RuleQueryStringCachingBehavior.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/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/Rules.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryMatchOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryMatchVariable.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryState.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/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/SecurityPolicyPropertiesParameters.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/SecurityPolicyUpdateParameters.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/ServerPortMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServiceSpecification.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceProperties.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/SocketAddrMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocol.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolOperator.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/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/UserAssignedIdentity.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/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/WafMatchVariable.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/WafMetricsGranularity.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/WafMetricsResponseSeriesItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemData.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/WafMetricsSeriesUnit.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/WafRankingsResponseDataItemMetric.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/azure-resourcemanager-cdn-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cdn-generated/proxy-config.json create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cdn-generated/reflect-config.json create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/azure-resourcemanager-cdn-generated.properties create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsListByProfileSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsRefreshValidationTokenSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListByProfileSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListResourceUsageSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsPurgeContentSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsValidateCustomDomainSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListByProfileSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListResourceUsageSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsListByOriginGroupSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckEndpointNameAvailabilitySamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckHostnameAvailabilitySamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesListResourceUsageSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesUpgradeSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesValidateSecretSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDisableCustomHttpsSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsEnableCustomHttpsSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsListByEndpointSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EdgeNodesListSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListByProfileSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListResourceUsageSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsLoadContentSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsPurgeContentSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStartSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStopSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsValidateCustomDomainSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsLocationsSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsMetricsSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsRankingsSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsResourcesSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsMetricsSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsRankingsSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ManagedRuleSetsListSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OperationsListSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsListByEndpointSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsListByEndpointSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesCreateOrUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesGetByResourceGroupSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesListByResourceGroupSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCanMigrateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCdnCanMigrateToAfdSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCdnMigrateToAfdSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGenerateSsoUriSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGetByResourceGroupSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListByResourceGroupSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListResourceUsageSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSupportedOptimizationTypesSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationAbortSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationCommitSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckEndpointNameAvailabilitySamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilitySamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilityWithSubscriptionSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderValidateProbeSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceUsageListSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesListByEndpointSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListByProfileSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListResourceUsageSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesListByRuleSetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesUpdateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsListByProfileSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesCreateSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesDeleteSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesGetSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesListByProfileSamples.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesPatchSamples.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 6445020c1866..bc96b28e2796 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -476,6 +476,7 @@ com.azure.resourcemanager:azure-resourcemanager-neonpostgres;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-pineconevectordb;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-impactreporting;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-migration-assessment;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-cdn-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 io.clientcore:clientcore-parent;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 698f1efc3d8f..832512a167f3 100644 --- a/pom.xml +++ b/pom.xml @@ -37,6 +37,7 @@ sdk/billingbenefits sdk/boms sdk/botservice + sdk/cdn sdk/changeanalysis sdk/chaos sdk/clientcore 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 000000000000..59fcff2fb620 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-02-27) + +- Azure Resource Manager Cdn client library for Java. This package contains Microsoft Azure SDK for Cdn Management SDK. Cdn Management Client. Package tag package-2024-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-cdn-generated Java SDK. 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 000000000000..2c441247a4f4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Cdn client library for Java + +Azure Resource Manager Cdn client library for Java. + +This package contains Microsoft Azure SDK for Cdn Management SDK. Cdn Management Client. Package tag package-2024-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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +CdnManager manager = CdnManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cdn/azure-resourcemanager-cdn-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/SAMPLE.md b/sdk/cdn/azure-resourcemanager-cdn-generated/SAMPLE.md new file mode 100644 index 000000000000..ae3d678592fd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/SAMPLE.md @@ -0,0 +1,3360 @@ +# Code snippets and samples + + +## AfdCustomDomains + +- [Create](#afdcustomdomains_create) +- [Delete](#afdcustomdomains_delete) +- [Get](#afdcustomdomains_get) +- [ListByProfile](#afdcustomdomains_listbyprofile) +- [RefreshValidationToken](#afdcustomdomains_refreshvalidationtoken) +- [Update](#afdcustomdomains_update) + +## AfdEndpoints + +- [Create](#afdendpoints_create) +- [Delete](#afdendpoints_delete) +- [Get](#afdendpoints_get) +- [ListByProfile](#afdendpoints_listbyprofile) +- [ListResourceUsage](#afdendpoints_listresourceusage) +- [PurgeContent](#afdendpoints_purgecontent) +- [Update](#afdendpoints_update) +- [ValidateCustomDomain](#afdendpoints_validatecustomdomain) + +## AfdOriginGroups + +- [Create](#afdorigingroups_create) +- [Delete](#afdorigingroups_delete) +- [Get](#afdorigingroups_get) +- [ListByProfile](#afdorigingroups_listbyprofile) +- [ListResourceUsage](#afdorigingroups_listresourceusage) +- [Update](#afdorigingroups_update) + +## AfdOrigins + +- [Create](#afdorigins_create) +- [Delete](#afdorigins_delete) +- [Get](#afdorigins_get) +- [ListByOriginGroup](#afdorigins_listbyorigingroup) +- [Update](#afdorigins_update) + +## AfdProfiles + +- [CheckEndpointNameAvailability](#afdprofiles_checkendpointnameavailability) +- [CheckHostnameAvailability](#afdprofiles_checkhostnameavailability) +- [ListResourceUsage](#afdprofiles_listresourceusage) +- [Upgrade](#afdprofiles_upgrade) +- [ValidateSecret](#afdprofiles_validatesecret) + +## CustomDomains + +- [Create](#customdomains_create) +- [Delete](#customdomains_delete) +- [DisableCustomHttps](#customdomains_disablecustomhttps) +- [EnableCustomHttps](#customdomains_enablecustomhttps) +- [Get](#customdomains_get) +- [ListByEndpoint](#customdomains_listbyendpoint) + +## EdgeNodes + +- [List](#edgenodes_list) + +## Endpoints + +- [Create](#endpoints_create) +- [Delete](#endpoints_delete) +- [Get](#endpoints_get) +- [ListByProfile](#endpoints_listbyprofile) +- [ListResourceUsage](#endpoints_listresourceusage) +- [LoadContent](#endpoints_loadcontent) +- [PurgeContent](#endpoints_purgecontent) +- [Start](#endpoints_start) +- [Stop](#endpoints_stop) +- [Update](#endpoints_update) +- [ValidateCustomDomain](#endpoints_validatecustomdomain) + +## LogAnalytics + +- [GetLogAnalyticsLocations](#loganalytics_getloganalyticslocations) +- [GetLogAnalyticsMetrics](#loganalytics_getloganalyticsmetrics) +- [GetLogAnalyticsRankings](#loganalytics_getloganalyticsrankings) +- [GetLogAnalyticsResources](#loganalytics_getloganalyticsresources) +- [GetWafLogAnalyticsMetrics](#loganalytics_getwafloganalyticsmetrics) +- [GetWafLogAnalyticsRankings](#loganalytics_getwafloganalyticsrankings) + +## ManagedRuleSets + +- [List](#managedrulesets_list) + +## Operations + +- [List](#operations_list) + +## OriginGroups + +- [Create](#origingroups_create) +- [Delete](#origingroups_delete) +- [Get](#origingroups_get) +- [ListByEndpoint](#origingroups_listbyendpoint) +- [Update](#origingroups_update) + +## Origins + +- [Create](#origins_create) +- [Delete](#origins_delete) +- [Get](#origins_get) +- [ListByEndpoint](#origins_listbyendpoint) +- [Update](#origins_update) + +## Policies + +- [CreateOrUpdate](#policies_createorupdate) +- [Delete](#policies_delete) +- [GetByResourceGroup](#policies_getbyresourcegroup) +- [ListByResourceGroup](#policies_listbyresourcegroup) +- [Update](#policies_update) + +## Profiles + +- [CanMigrate](#profiles_canmigrate) +- [CdnCanMigrateToAfd](#profiles_cdncanmigratetoafd) +- [CdnMigrateToAfd](#profiles_cdnmigratetoafd) +- [Create](#profiles_create) +- [Delete](#profiles_delete) +- [GenerateSsoUri](#profiles_generatessouri) +- [GetByResourceGroup](#profiles_getbyresourcegroup) +- [List](#profiles_list) +- [ListByResourceGroup](#profiles_listbyresourcegroup) +- [ListResourceUsage](#profiles_listresourceusage) +- [ListSupportedOptimizationTypes](#profiles_listsupportedoptimizationtypes) +- [Migrate](#profiles_migrate) +- [MigrationAbort](#profiles_migrationabort) +- [MigrationCommit](#profiles_migrationcommit) +- [Update](#profiles_update) + +## ResourceProvider + +- [CheckEndpointNameAvailability](#resourceprovider_checkendpointnameavailability) +- [CheckNameAvailability](#resourceprovider_checknameavailability) +- [CheckNameAvailabilityWithSubscription](#resourceprovider_checknameavailabilitywithsubscription) +- [ValidateProbe](#resourceprovider_validateprobe) + +## ResourceUsage + +- [List](#resourceusage_list) + +## Routes + +- [Create](#routes_create) +- [Delete](#routes_delete) +- [Get](#routes_get) +- [ListByEndpoint](#routes_listbyendpoint) +- [Update](#routes_update) + +## RuleSets + +- [Create](#rulesets_create) +- [Delete](#rulesets_delete) +- [Get](#rulesets_get) +- [ListByProfile](#rulesets_listbyprofile) +- [ListResourceUsage](#rulesets_listresourceusage) + +## Rules + +- [Create](#rules_create) +- [Delete](#rules_delete) +- [Get](#rules_get) +- [ListByRuleSet](#rules_listbyruleset) +- [Update](#rules_update) + +## Secrets + +- [Create](#secrets_create) +- [Delete](#secrets_delete) +- [Get](#secrets_get) +- [ListByProfile](#secrets_listbyprofile) + +## SecurityPolicies + +- [Create](#securitypolicies_create) +- [Delete](#securitypolicies_delete) +- [Get](#securitypolicies_get) +- [ListByProfile](#securitypolicies_listbyprofile) +- [Patch](#securitypolicies_patch) +### AfdCustomDomains_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.AfdCertificateType; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdMinimumTlsVersion; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** + * Samples for AfdCustomDomains Create. + */ +public final class AfdCustomDomainsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_Create.json + */ + /** + * Sample code: AFDCustomDomains_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains() + .define("domain1") + .withExistingProfile("RG", "profile1") + .withHostname("www.someDomain.net") + .withTlsSettings(new AfdDomainHttpsParameters().withCertificateType(AfdCertificateType.MANAGED_CERTIFICATE) + .withMinimumTlsVersion(AfdMinimumTlsVersion.TLS12)) + .withAzureDnsZone(new ResourceReference().withId("")) + .create(); + } +} +``` + +### AfdCustomDomains_Delete + +```java +/** + * Samples for AfdCustomDomains Delete. + */ +public final class AfdCustomDomainsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_Delete.json + */ + /** + * Sample code: AFDCustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().delete("RG", "profile1", "domain1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdCustomDomains_Get + +```java +/** + * Samples for AfdCustomDomains Get. + */ +public final class AfdCustomDomainsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_Get.json + */ + /** + * Sample code: AFDCustomDomains_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().getWithResponse("RG", "profile1", "domain1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdCustomDomains_ListByProfile + +```java +/** + * Samples for AfdCustomDomains ListByProfile. + */ +public final class AfdCustomDomainsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_ListByProfile.json + */ + /** + * Sample code: AFDCustomDomains_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdCustomDomains_RefreshValidationToken + +```java +/** + * Samples for AfdCustomDomains RefreshValidationToken. + */ +public final class AfdCustomDomainsRefreshValidationTokenSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * AFDCustomDomains_RefreshValidationToken.json + */ + /** + * Sample code: AFDCustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains() + .refreshValidationToken("RG", "profile1", "domain1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdCustomDomains_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.AfdCertificateType; +import com.azure.resourcemanager.cdn.generated.models.AfdDomain; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdMinimumTlsVersion; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** + * Samples for AfdCustomDomains Update. + */ +public final class AfdCustomDomainsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_Update.json + */ + /** + * Sample code: AFDCustomDomains_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdDomain resource = manager.afdCustomDomains() + .getWithResponse("RG", "profile1", "domain1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTlsSettings(new AfdDomainHttpsParameters().withCertificateType(AfdCertificateType.CUSTOMER_CERTIFICATE) + .withMinimumTlsVersion(AfdMinimumTlsVersion.TLS12)) + .withAzureDnsZone(new ResourceReference().withId("")) + .apply(); + } +} +``` + +### AfdEndpoints_Create + +```java +/** + * Samples for AfdEndpoints Create. + */ +public final class AfdEndpointsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_Create.json + */ + /** + * Sample code: AFDEndpoints_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints() + .define("endpoint1") + .withRegion((String) null) + .withExistingProfile("RG", "profile1") + .create(); + } +} +``` + +### AfdEndpoints_Delete + +```java +/** + * Samples for AfdEndpoints Delete. + */ +public final class AfdEndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_Delete.json + */ + /** + * Sample code: AFDEndpoints_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().delete("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdEndpoints_Get + +```java +/** + * Samples for AfdEndpoints Get. + */ +public final class AfdEndpointsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_Get.json + */ + /** + * Sample code: AFDEndpoints_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().getWithResponse("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdEndpoints_ListByProfile + +```java +/** + * Samples for AfdEndpoints ListByProfile. + */ +public final class AfdEndpointsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_ListByProfile.json + */ + /** + * Sample code: AFDEndpoints_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdEndpoints_ListResourceUsage + +```java +/** + * Samples for AfdEndpoints ListResourceUsage. + */ +public final class AfdEndpointsListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_ListResourceUsage.json + */ + /** + * Sample code: AFDEndpoints_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().listResourceUsage("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdEndpoints_PurgeContent + +```java +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import java.util.Arrays; + +/** + * Samples for AfdEndpoints PurgeContent. + */ +public final class AfdEndpointsPurgeContentSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_PurgeContent.json + */ + /** + * Sample code: AFDEndpoints_PurgeContent. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsPurgeContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints() + .purgeContent("RG", "profile1", "endpoint1", + new AfdPurgeParameters().withContentPaths(Arrays.asList("/folder1")) + .withDomains(Arrays.asList("endpoint1-abcdefghijklmnop.z01.azurefd.net")), + com.azure.core.util.Context.NONE); + } +} +``` + +### AfdEndpoints_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoint; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AfdEndpoints Update. + */ +public final class AfdEndpointsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_Update.json + */ + /** + * Sample code: AFDEndpoints_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdEndpoint resource = manager.afdEndpoints() + .getWithResponse("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf()).withEnabledState(EnabledState.ENABLED).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### AfdEndpoints_ValidateCustomDomain + +```java +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** + * Samples for AfdEndpoints ValidateCustomDomain. + */ +public final class AfdEndpointsValidateCustomDomainSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_ValidateCustomDomain. + * json + */ + /** + * Sample code: Endpoints_ValidateCustomDomain. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsValidateCustomDomain(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints() + .validateCustomDomainWithResponse("RG", "profile1", "endpoint1", + new ValidateCustomDomainInput().withHostname("www.someDomain.com"), com.azure.core.util.Context.NONE); + } +} +``` + +### AfdOriginGroups_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; + +/** + * Samples for AfdOriginGroups Create. + */ +public final class AfdOriginGroupsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_Create.json + */ + /** + * Sample code: AFDOriginGroups_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups() + .define("origingroup1") + .withExistingProfile("RG", "profile1") + .withLoadBalancingSettings(new LoadBalancingSettingsParameters().withSampleSize(3) + .withSuccessfulSamplesRequired(3) + .withAdditionalLatencyInMilliseconds(1000)) + .withHealthProbeSettings(new HealthProbeParameters().withProbePath("/path2") + .withProbeRequestType(HealthProbeRequestType.NOT_SET) + .withProbeProtocol(ProbeProtocol.NOT_SET) + .withProbeIntervalInSeconds(10)) + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes(5) + .create(); + } +} +``` + +### AfdOriginGroups_Delete + +```java +/** + * Samples for AfdOriginGroups Delete. + */ +public final class AfdOriginGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_Delete.json + */ + /** + * Sample code: AFDOriginGroups_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().delete("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdOriginGroups_Get + +```java +/** + * Samples for AfdOriginGroups Get. + */ +public final class AfdOriginGroupsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_Get.json + */ + /** + * Sample code: AFDOriginGroups_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().getWithResponse("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdOriginGroups_ListByProfile + +```java +/** + * Samples for AfdOriginGroups ListByProfile. + */ +public final class AfdOriginGroupsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_ListByProfile.json + */ + /** + * Sample code: AFDOriginGroups_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdOriginGroups_ListResourceUsage + +```java +/** + * Samples for AfdOriginGroups ListResourceUsage. + */ +public final class AfdOriginGroupsListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_ListResourceUsage. + * json + */ + /** + * Sample code: AFDOriginGroups_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().listResourceUsage("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdOriginGroups_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; + +/** + * Samples for AfdOriginGroups Update. + */ +public final class AfdOriginGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_Update.json + */ + /** + * Sample code: AFDOriginGroups_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdOriginGroup resource = manager.afdOriginGroups() + .getWithResponse("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withLoadBalancingSettings(new LoadBalancingSettingsParameters().withSampleSize(3) + .withSuccessfulSamplesRequired(3) + .withAdditionalLatencyInMilliseconds(1000)) + .withHealthProbeSettings(new HealthProbeParameters().withProbePath("/path2") + .withProbeRequestType(HealthProbeRequestType.NOT_SET) + .withProbeProtocol(ProbeProtocol.NOT_SET) + .withProbeIntervalInSeconds(10)) + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes(5) + .apply(); + } +} +``` + +### AfdOrigins_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.EnabledState; + +/** + * Samples for AfdOrigins Create. + */ +public final class AfdOriginsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_Create.json + */ + /** + * Sample code: AFDOrigins_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins() + .define("origin1") + .withExistingOriginGroup("RG", "profile1", "origingroup1") + .withHostname("host1.blob.core.windows.net") + .withHttpPort(80) + .withHttpsPort(443) + .withOriginHostHeader("host1.foo.com") + .withEnabledState(EnabledState.ENABLED) + .create(); + } +} +``` + +### AfdOrigins_Delete + +```java +/** + * Samples for AfdOrigins Delete. + */ +public final class AfdOriginsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_Delete.json + */ + /** + * Sample code: AFDOrigins_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().delete("RG", "profile1", "origingroup1", "origin1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdOrigins_Get + +```java +/** + * Samples for AfdOrigins Get. + */ +public final class AfdOriginsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_Get.json + */ + /** + * Sample code: AFDOrigins_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins() + .getWithResponse("RG", "profile1", "origingroup1", "origin1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdOrigins_ListByOriginGroup + +```java +/** + * Samples for AfdOrigins ListByOriginGroup. + */ +public final class AfdOriginsListByOriginGroupSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_ListByOriginGroup.json + */ + /** + * Sample code: AFDOrigins_ListByOriginGroup. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsListByOriginGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().listByOriginGroup("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdOrigins_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.AfdOrigin; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; + +/** + * Samples for AfdOrigins Update. + */ +public final class AfdOriginsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_Update.json + */ + /** + * Sample code: AFDOrigins_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdOrigin resource = manager.afdOrigins() + .getWithResponse("RG", "profile1", "origingroup1", "origin1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withHostname("host1.blob.core.windows.net") + .withHttpPort(80) + .withHttpsPort(443) + .withEnabledState(EnabledState.ENABLED) + .apply(); + } +} +``` + +### AfdProfiles_CheckEndpointNameAvailability + +```java +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** + * Samples for AfdProfiles CheckEndpointNameAvailability. + */ +public final class AfdProfilesCheckEndpointNameAvailabilitySamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * AFDProfiles_CheckEndpointNameAvailability.json + */ + /** + * Sample code: CheckEndpointNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkEndpointNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles() + .checkEndpointNameAvailabilityWithResponse("myResourceGroup", "profile1", + new CheckEndpointNameAvailabilityInput().withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_AFD_ENDPOINTS) + .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE), + com.azure.core.util.Context.NONE); + } +} +``` + +### AfdProfiles_CheckHostnameAvailability + +```java +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; + +/** + * Samples for AfdProfiles CheckHostnameAvailability. + */ +public final class AfdProfilesCheckHostnameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDProfiles_CheckHostNameAvailability + * .json + */ + /** + * Sample code: AFDProfiles_CheckHostNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void + aFDProfilesCheckHostNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles() + .checkHostnameAvailabilityWithResponse("RG", "profile1", + new CheckHostnameAvailabilityInput().withHostname("www.someDomain.net"), + com.azure.core.util.Context.NONE); + } +} +``` + +### AfdProfiles_ListResourceUsage + +```java +/** + * Samples for AfdProfiles ListResourceUsage. + */ +public final class AfdProfilesListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDProfiles_ListResourceUsage.json + */ + /** + * Sample code: AFDProfiles_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles().listResourceUsage("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### AfdProfiles_Upgrade + +```java +import com.azure.resourcemanager.cdn.generated.models.ProfileChangeSkuWafMapping; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** + * Samples for AfdProfiles Upgrade. + */ +public final class AfdProfilesUpgradeSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDProfiles_Upgrade.json + */ + /** + * Sample code: AFDProfiles_Upgrade. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesUpgrade(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles() + .upgrade("RG", "profile1", + new ProfileUpgradeParameters().withWafMappingList(Arrays.asList(new ProfileChangeSkuWafMapping() + .withSecurityPolicyName("securityPolicy1") + .withChangeToWafPolicy(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/waf2")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### AfdProfiles_ValidateSecret + +```java +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecretType; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; + +/** + * Samples for AfdProfiles ValidateSecret. + */ +public final class AfdProfilesValidateSecretSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDProfiles_ValidateSecret.json + */ + /** + * Sample code: Validate_Secret. + * + * @param manager Entry point to CdnManager. + */ + public static void validateSecret(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles() + .validateSecretWithResponse("RG", "profile1", new ValidateSecretInput() + .withSecretType(SecretType.CUSTOMER_CERTIFICATE) + .withSecretSource(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/certificate/certName")), + com.azure.core.util.Context.NONE); + } +} +``` + +### CustomDomains_Create + +```java +/** + * Samples for CustomDomains Create. + */ +public final class CustomDomainsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_Create.json + */ + /** + * Sample code: CustomDomains_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .define("www-someDomain-net") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHostname("www.someDomain.net") + .create(); + } +} +``` + +### CustomDomains_Delete + +```java +/** + * Samples for CustomDomains Delete. + */ +public final class CustomDomainsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_Delete.json + */ + /** + * Sample code: CustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .delete("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomDomains_DisableCustomHttps + +```java +/** + * Samples for CustomDomains DisableCustomHttps. + */ +public final class CustomDomainsDisableCustomHttpsSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_DisableCustomHttps.json + */ + /** + * Sample code: CustomDomains_DisableCustomHttps. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsDisableCustomHttps(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .disableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomDomains_EnableCustomHttps + +```java + +/** + * Samples for CustomDomains EnableCustomHttps. + */ +public final class CustomDomainsEnableCustomHttpsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json + */ + /** + * Sample code: CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsEnableCustomHttpsUsingCDNManagedCertificate( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .enableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * CustomDomains_EnableCustomHttpsUsingBYOC.json + */ + /** + * Sample code: CustomDomains_EnableCustomHttpsUsingYourOwnCertificate. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsEnableCustomHttpsUsingYourOwnCertificate( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .enableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### CustomDomains_Get + +```java +/** + * Samples for CustomDomains Get. + */ +public final class CustomDomainsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_Get.json + */ + /** + * Sample code: CustomDomains_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomDomains_ListByEndpoint + +```java +/** + * Samples for CustomDomains ListByEndpoint. + */ +public final class CustomDomainsListByEndpointSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_ListByEndpoint.json + */ + /** + * Sample code: CustomDomains_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().listByEndpoint("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeNodes_List + +```java +/** + * Samples for EdgeNodes List. + */ +public final class EdgeNodesListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/EdgeNodes_List.json + */ + /** + * Sample code: EdgeNodes_List. + * + * @param manager Entry point to CdnManager. + */ + public static void edgeNodesList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.edgeNodes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Endpoints_Create + +```java +/** + * Samples for Endpoints Create. + */ +public final class EndpointsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Create.json + */ + /** + * Sample code: Endpoints_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints() + .define("endpoint1") + .withRegion((String) null) + .withExistingProfile("RG", "profile1") + .create(); + } +} +``` + +### Endpoints_Delete + +```java +/** + * Samples for Endpoints Delete. + */ +public final class EndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Delete.json + */ + /** + * Sample code: Endpoints_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().delete("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### Endpoints_Get + +```java +/** + * Samples for Endpoints Get. + */ +public final class EndpointsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Get.json + */ + /** + * Sample code: Endpoints_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().getWithResponse("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### Endpoints_ListByProfile + +```java +/** + * Samples for Endpoints ListByProfile. + */ +public final class EndpointsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_ListByProfile.json + */ + /** + * Sample code: Endpoints_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### Endpoints_ListResourceUsage + +```java +/** + * Samples for Endpoints ListResourceUsage. + */ +public final class EndpointsListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_ListResourceUsage.json + */ + /** + * Sample code: Endpoints_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().listResourceUsage("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### Endpoints_LoadContent + +```java +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import java.util.Arrays; + +/** + * Samples for Endpoints LoadContent. + */ +public final class EndpointsLoadContentSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_LoadContent.json + */ + /** + * Sample code: Endpoints_LoadContent. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsLoadContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints() + .loadContent("RG", "profile1", "endpoint1", + new LoadParameters().withContentPaths(Arrays.asList("/folder1")), com.azure.core.util.Context.NONE); + } +} +``` + +### Endpoints_PurgeContent + +```java +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import java.util.Arrays; + +/** + * Samples for Endpoints PurgeContent. + */ +public final class EndpointsPurgeContentSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_PurgeContent.json + */ + /** + * Sample code: Endpoints_PurgeContent. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsPurgeContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints() + .purgeContent("RG", "profile1", "endpoint1", + new PurgeParameters().withContentPaths(Arrays.asList("/folder1")), com.azure.core.util.Context.NONE); + } +} +``` + +### Endpoints_Start + +```java +/** + * Samples for Endpoints Start. + */ +public final class EndpointsStartSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Start.json + */ + /** + * Sample code: Endpoints_Start. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsStart(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().start("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### Endpoints_Stop + +```java +/** + * Samples for Endpoints Stop. + */ +public final class EndpointsStopSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Stop.json + */ + /** + * Sample code: Endpoints_Stop. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsStop(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().stop("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### Endpoints_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.Endpoint; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Endpoints Update. + */ +public final class EndpointsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Update.json + */ + /** + * Sample code: Endpoints_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Endpoint resource = manager.endpoints() + .getWithResponse("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "Tag1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Endpoints_ValidateCustomDomain + +```java +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** + * Samples for Endpoints ValidateCustomDomain. + */ +public final class EndpointsValidateCustomDomainSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_ValidateCustomDomain.json + */ + /** + * Sample code: Endpoints_ValidateCustomDomain. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsValidateCustomDomain(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints() + .validateCustomDomainWithResponse("RG", "profile1", "endpoint1", + new ValidateCustomDomainInput().withHostname("www.someDomain.com"), com.azure.core.util.Context.NONE); + } +} +``` + +### LogAnalytics_GetLogAnalyticsLocations + +```java +/** + * Samples for LogAnalytics GetLogAnalyticsLocations. + */ +public final class LogAnalyticsGetLogAnalyticsLocationsSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/LogAnalytics_GetLogAnalyticsLocations + * .json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsLocations. + * + * @param manager Entry point to CdnManager. + */ + public static void + logAnalyticsGetLogAnalyticsLocations(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics().getLogAnalyticsLocationsWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### LogAnalytics_GetLogAnalyticsMetrics + +```java +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for LogAnalytics GetLogAnalyticsMetrics. + */ +public final class LogAnalyticsGetLogAnalyticsMetricsSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/LogAnalytics_GetLogAnalyticsMetrics. + * json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsMetrics. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsMetrics(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics() + .getLogAnalyticsMetricsWithResponse("RG", "profile1", Arrays.asList(LogMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T04:30:00.000Z"), OffsetDateTime.parse("2020-11-04T05:00:00.000Z"), + LogMetricsGranularity.PT5M, Arrays.asList("customdomain1.azurecdn.net", "customdomain2.azurecdn.net"), + Arrays.asList("https"), Arrays.asList(LogMetricsGroupBy.PROTOCOL), null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### LogAnalytics_GetLogAnalyticsRankings + +```java +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for LogAnalytics GetLogAnalyticsRankings. + */ +public final class LogAnalyticsGetLogAnalyticsRankingsSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/LogAnalytics_GetLogAnalyticsRankings. + * json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsRankings. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsRankings(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics() + .getLogAnalyticsRankingsWithResponse("RG", "profile1", Arrays.asList(LogRanking.URL), + Arrays.asList(LogRankingMetric.CLIENT_REQUEST_COUNT), 5, + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + null, com.azure.core.util.Context.NONE); + } +} +``` + +### LogAnalytics_GetLogAnalyticsResources + +```java +/** + * Samples for LogAnalytics GetLogAnalyticsResources. + */ +public final class LogAnalyticsGetLogAnalyticsResourcesSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/LogAnalytics_GetLogAnalyticsResources + * .json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsResources. + * + * @param manager Entry point to CdnManager. + */ + public static void + logAnalyticsGetLogAnalyticsResources(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics().getLogAnalyticsResourcesWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### LogAnalytics_GetWafLogAnalyticsMetrics + +```java +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for LogAnalytics GetWafLogAnalyticsMetrics. + */ +public final class LogAnalyticsGetWafLogAnalyticsMetricsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * LogAnalytics_GetWafLogAnalyticsMetrics.json + */ + /** + * Sample code: LogAnalytics_GetWafLogAnalyticsMetrics. + * + * @param manager Entry point to CdnManager. + */ + public static void + logAnalyticsGetWafLogAnalyticsMetrics(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics() + .getWafLogAnalyticsMetricsWithResponse("RG", "profile1", Arrays.asList(WafMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + WafGranularity.PT5M, Arrays.asList(WafAction.BLOCK, WafAction.LOG), null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### LogAnalytics_GetWafLogAnalyticsRankings + +```java +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for LogAnalytics GetWafLogAnalyticsRankings. + */ +public final class LogAnalyticsGetWafLogAnalyticsRankingsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * LogAnalytics_GetWafLogAnalyticsRankings.json + */ + /** + * Sample code: LogAnalytics_GetWafLogAnalyticsRankings. + * + * @param manager Entry point to CdnManager. + */ + public static void + logAnalyticsGetWafLogAnalyticsRankings(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics() + .getWafLogAnalyticsRankingsWithResponse("RG", "profile1", Arrays.asList(WafMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), 5, + Arrays.asList(WafRankingType.RULE_ID), null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedRuleSets_List + +```java +/** + * Samples for ManagedRuleSets List. + */ +public final class ManagedRuleSetsListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafListManagedRuleSets.json + */ + /** + * Sample code: List Policies in a Resource Group. + * + * @param manager Entry point to CdnManager. + */ + public static void listPoliciesInAResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.managedRuleSets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to CdnManager. + */ + public static void operationsList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### OriginGroups_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedDetectedErrorTypes; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.util.Arrays; + +/** + * Samples for OriginGroups Create. + */ +public final class OriginGroupsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_Create.json + */ + /** + * Sample code: OriginGroups_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups() + .define("origingroup1") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHealthProbeSettings(new HealthProbeParameters().withProbePath("/health.aspx") + .withProbeRequestType(HealthProbeRequestType.GET) + .withProbeProtocol(ProbeProtocol.HTTP) + .withProbeIntervalInSeconds(120)) + .withOrigins(Arrays.asList(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"))) + .withResponseBasedOriginErrorDetectionSettings(new ResponseBasedOriginErrorDetectionParameters() + .withResponseBasedDetectedErrorTypes(ResponseBasedDetectedErrorTypes.TCP_ERRORS_ONLY) + .withResponseBasedFailoverThresholdPercentage(10)) + .create(); + } +} +``` + +### OriginGroups_Delete + +```java +/** + * Samples for OriginGroups Delete. + */ +public final class OriginGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_Delete.json + */ + /** + * Sample code: OriginGroups_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().delete("RG", "profile1", "endpoint1", "originGroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### OriginGroups_Get + +```java +/** + * Samples for OriginGroups Get. + */ +public final class OriginGroupsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_Get.json + */ + /** + * Sample code: OriginGroups_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups() + .getWithResponse("RG", "profile1", "endpoint1", "originGroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### OriginGroups_ListByEndpoint + +```java +/** + * Samples for OriginGroups ListByEndpoint. + */ +public final class OriginGroupsListByEndpointSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_ListByEndpoint.json + */ + /** + * Sample code: OriginsGroups_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void originsGroupsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().listByEndpoint("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### OriginGroups_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.OriginGroup; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** + * Samples for OriginGroups Update. + */ +public final class OriginGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_Update.json + */ + /** + * Sample code: OriginGroups_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + OriginGroup resource = manager.originGroups() + .getWithResponse("RG", "profile1", "endpoint1", "originGroup1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withHealthProbeSettings(new HealthProbeParameters().withProbePath("/health.aspx") + .withProbeRequestType(HealthProbeRequestType.GET) + .withProbeProtocol(ProbeProtocol.HTTP) + .withProbeIntervalInSeconds(120)) + .withOrigins(Arrays.asList(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2"))) + .apply(); + } +} +``` + +### Origins_Create + +```java +/** + * Samples for Origins Create. + */ +public final class OriginsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_Create.json + */ + /** + * Sample code: Origins_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void originsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins() + .define("www-someDomain-net") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHostname("www.someDomain.net") + .withHttpPort(80) + .withHttpsPort(443) + .withOriginHostHeader("www.someDomain.net") + .withPriority(1) + .withWeight(50) + .withEnabled(true) + .withPrivateLinkResourceId( + "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Network/privateLinkServices/pls1") + .withPrivateLinkLocation("eastus") + .withPrivateLinkApprovalMessage("Please approve the connection request for this Private Link") + .create(); + } +} +``` + +### Origins_Delete + +```java +/** + * Samples for Origins Delete. + */ +public final class OriginsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_Delete.json + */ + /** + * Sample code: Origins_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void originsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().delete("RG", "profile1", "endpoint1", "origin1", com.azure.core.util.Context.NONE); + } +} +``` + +### Origins_Get + +```java +/** + * Samples for Origins Get. + */ +public final class OriginsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_Get.json + */ + /** + * Sample code: Origins_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void originsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins() + .getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE); + } +} +``` + +### Origins_ListByEndpoint + +```java +/** + * Samples for Origins ListByEndpoint. + */ +public final class OriginsListByEndpointSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_ListByEndpoint.json + */ + /** + * Sample code: Origins_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void originsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().listByEndpoint("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### Origins_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.Origin; + +/** + * Samples for Origins Update. + */ +public final class OriginsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_Update.json + */ + /** + * Sample code: Origins_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void originsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Origin resource = manager.origins() + .getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withHttpPort(42) + .withHttpsPort(43) + .withOriginHostHeader("www.someDomain2.net") + .withPriority(1) + .withWeight(50) + .withEnabled(true) + .withPrivateLinkAlias("APPSERVER.d84e61f0-0870-4d24-9746-7438fa0019d1.westus2.azure.privatelinkservice") + .apply(); + } +} +``` + +### Policies_CreateOrUpdate + +```java +import com.azure.resourcemanager.cdn.generated.models.ActionType; +import com.azure.resourcemanager.cdn.generated.models.CustomRule; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleEnabledState; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleList; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleEnabledState; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupOverride; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleOverride; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSet; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetList; +import com.azure.resourcemanager.cdn.generated.models.MatchCondition; +import com.azure.resourcemanager.cdn.generated.models.Operator; +import com.azure.resourcemanager.cdn.generated.models.PolicySettings; +import com.azure.resourcemanager.cdn.generated.models.PolicySettingsDefaultCustomBlockResponseStatusCode; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRule; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRuleList; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; +import com.azure.resourcemanager.cdn.generated.models.TransformType; +import com.azure.resourcemanager.cdn.generated.models.WafMatchVariable; +import java.util.Arrays; + +/** + * Samples for Policies CreateOrUpdate. + */ +public final class PoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafPolicyCreateOrUpdate.json + */ + /** + * Sample code: Creates specific policy. + * + * @param manager Entry point to CdnManager. + */ + public static void createsSpecificPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies() + .define("MicrosoftCdnWafPolicy") + .withRegion("WestUs") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.STANDARD_MICROSOFT)) + .withPolicySettings(new PolicySettings().withDefaultRedirectUrl("http://www.bing.com") + .withDefaultCustomBlockResponseStatusCode( + PolicySettingsDefaultCustomBlockResponseStatusCode.TWO_ZERO_ZERO) + .withDefaultCustomBlockResponseBody( + "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==")) + .withRateLimitRules(new RateLimitRuleList().withRules(Arrays.asList(new RateLimitRule() + .withName("RateLimitRule1") + .withEnabledState(CustomRuleEnabledState.ENABLED) + .withPriority(1) + .withMatchConditions(Arrays.asList(new MatchCondition().withMatchVariable(WafMatchVariable.REMOTE_ADDR) + .withOperator(Operator.IPMATCH) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("192.168.1.0/24", "10.0.0.0/24")) + .withTransforms(Arrays.asList()))) + .withAction(ActionType.BLOCK) + .withRateLimitThreshold(1000) + .withRateLimitDurationInMinutes(0)))) + .withCustomRules(new CustomRuleList().withRules(Arrays.asList(new CustomRule().withName("CustomRule1") + .withEnabledState(CustomRuleEnabledState.ENABLED) + .withPriority(2) + .withMatchConditions(Arrays.asList( + new MatchCondition().withMatchVariable(WafMatchVariable.REMOTE_ADDR) + .withOperator(Operator.GEO_MATCH) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("CH")) + .withTransforms(Arrays.asList()), + new MatchCondition().withMatchVariable(WafMatchVariable.REQUEST_HEADER) + .withSelector("UserAgent") + .withOperator(Operator.CONTAINS) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("windows")) + .withTransforms(Arrays.asList()), + new MatchCondition().withMatchVariable(WafMatchVariable.QUERY_STRING) + .withSelector("search") + .withOperator(Operator.CONTAINS) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("")) + .withTransforms(Arrays.asList(TransformType.URL_DECODE, TransformType.LOWERCASE)))) + .withAction(ActionType.BLOCK)))) + .withManagedRules(new ManagedRuleSetList() + .withManagedRuleSets(Arrays.asList(new ManagedRuleSet().withRuleSetType("DefaultRuleSet") + .withRuleSetVersion("preview-1.0") + .withRuleGroupOverrides(Arrays.asList(new ManagedRuleGroupOverride().withRuleGroupName("Group1") + .withRules(Arrays.asList( + new ManagedRuleOverride().withRuleId("GROUP1-0001") + .withEnabledState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.REDIRECT), + new ManagedRuleOverride().withRuleId("GROUP1-0002") + .withEnabledState(ManagedRuleEnabledState.DISABLED)))))))) + .create(); + } +} +``` + +### Policies_Delete + +```java +/** + * Samples for Policies Delete. + */ +public final class PoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafPolicyDelete.json + */ + /** + * Sample code: Delete protection policy. + * + * @param manager Entry point to CdnManager. + */ + public static void deleteProtectionPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().deleteByResourceGroupWithResponse("rg1", "Policy1", com.azure.core.util.Context.NONE); + } +} +``` + +### Policies_GetByResourceGroup + +```java +/** + * Samples for Policies GetByResourceGroup. + */ +public final class PoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafPolicyGet.json + */ + /** + * Sample code: Get Policy. + * + * @param manager Entry point to CdnManager. + */ + public static void getPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies() + .getByResourceGroupWithResponse("rg1", "MicrosoftCdnWafPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### Policies_ListByResourceGroup + +```java +/** + * Samples for Policies ListByResourceGroup. + */ +public final class PoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafListPolicies.json + */ + /** + * Sample code: List Policies in a Resource Group. + * + * @param manager Entry point to CdnManager. + */ + public static void listPoliciesInAResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### Policies_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Policies Update. + */ +public final class PoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafPatchPolicy.json + */ + /** + * Sample code: Creates specific policy. + * + * @param manager Entry point to CdnManager. + */ + public static void createsSpecificPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + CdnWebApplicationFirewallPolicy resource = manager.policies() + .getByResourceGroupWithResponse("rg1", "MicrosoftCdnWafPolicy", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("foo", "bar")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Profiles_CanMigrate + +```java +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** + * Samples for Profiles CanMigrate. + */ +public final class ProfilesCanMigrateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_CanMigrate.json + */ + /** + * Sample code: Profiles_CanMigrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCanMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .canMigrate("RG", + new CanMigrateParameters().withClassicResourceReference(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_CdnCanMigrateToAfd + +```java +/** + * Samples for Profiles CdnCanMigrateToAfd. + */ +public final class ProfilesCdnCanMigrateToAfdSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CdnProfiles_CanMigrate.json + */ + /** + * Sample code: Profiles_CdnCanMigrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCdnCanMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().cdnCanMigrateToAfd("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_CdnMigrateToAfd + +```java +import com.azure.resourcemanager.cdn.generated.models.CdnMigrationToAfdParameters; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** + * Samples for Profiles CdnMigrateToAfd. + */ +public final class ProfilesCdnMigrateToAfdSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CdnProfiles_Migrate.json + */ + /** + * Sample code: Profiles_CdnMigrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCdnMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .cdnMigrateToAfd("RG", "profile1", + new CdnMigrationToAfdParameters().withSku(new Sku().withName(SkuName.STANDARD_AZURE_FRONT_DOOR)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** + * Samples for Profiles Create. + */ +public final class ProfilesCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Create.json + */ + /** + * Sample code: Profiles_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .define("profile1") + .withRegion("global") + .withExistingResourceGroup("RG") + .withSku(new Sku().withName(SkuName.PREMIUM_AZURE_FRONT_DOOR)) + .create(); + } +} +``` + +### Profiles_Delete + +```java +/** + * Samples for Profiles Delete. + */ +public final class ProfilesDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Delete.json + */ + /** + * Sample code: Profiles_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().delete("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_GenerateSsoUri + +```java +/** + * Samples for Profiles GenerateSsoUri. + */ +public final class ProfilesGenerateSsoUriSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_GenerateSsoUri.json + */ + /** + * Sample code: Profiles_GenerateSsoUri. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesGenerateSsoUri(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().generateSsoUriWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_GetByResourceGroup + +```java +/** + * Samples for Profiles GetByResourceGroup. + */ +public final class ProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Get.json + */ + /** + * Sample code: Profiles_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().getByResourceGroupWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_List + +```java +/** + * Samples for Profiles List. + */ +public final class ProfilesListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_List.json + */ + /** + * Sample code: Profiles_List. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_ListByResourceGroup + +```java +/** + * Samples for Profiles ListByResourceGroup. + */ +public final class ProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_ListByResourceGroup.json + */ + /** + * Sample code: Profiles_ListByResourceGroup. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListByResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listByResourceGroup("RG", com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_ListResourceUsage + +```java +/** + * Samples for Profiles ListResourceUsage. + */ +public final class ProfilesListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_ListResourceUsage.json + */ + /** + * Sample code: Profiles_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listResourceUsage("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_ListSupportedOptimizationTypes + +```java +/** + * Samples for Profiles ListSupportedOptimizationTypes. + */ +public final class ProfilesListSupportedOptimizationTypesSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * Profiles_ListSupportedOptimizationTypes.json + */ + /** + * Sample code: Profiles_ListSupportedOptimizationTypes. + * + * @param manager Entry point to CdnManager. + */ + public static void + profilesListSupportedOptimizationTypes(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .listSupportedOptimizationTypesWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_Migrate + +```java +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** + * Samples for Profiles Migrate. + */ +public final class ProfilesMigrateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Migrate.json + */ + /** + * Sample code: Profiles_Migrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .migrate("RG", + new MigrationParameters().withSku(new Sku().withName(SkuName.STANDARD_AZURE_FRONT_DOOR)) + .withClassicResourceReference(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname")) + .withProfileName("profile1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_MigrationAbort + +```java +/** + * Samples for Profiles MigrationAbort. + */ +public final class ProfilesMigrationAbortSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_MigrationAbort.json + */ + /** + * Sample code: Profiles_CdnMigrationCommit. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCdnMigrationCommit(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().migrationAbort("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_MigrationCommit + +```java +/** + * Samples for Profiles MigrationCommit. + */ +public final class ProfilesMigrationCommitSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_MigrationCommit.json + */ + /** + * Sample code: Profiles_MigrationCommit. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesMigrationCommit(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().migrationCommit("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### Profiles_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.Profile; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Profiles Update. + */ +public final class ProfilesUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Update.json + */ + /** + * Sample code: Profiles_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Profile resource = manager.profiles() + .getByResourceGroupWithResponse("RG", "profile1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "Tag1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ResourceProvider_CheckEndpointNameAvailability + +```java +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** + * Samples for ResourceProvider CheckEndpointNameAvailability. + */ +public final class ResourceProviderCheckEndpointNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CheckEndpointNameAvailability.json + */ + /** + * Sample code: CheckEndpointNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkEndpointNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceProviders() + .checkEndpointNameAvailabilityWithResponse("myResourceGroup", + new CheckEndpointNameAvailabilityInput().withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_AFD_ENDPOINTS) + .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_CheckNameAvailability + +```java +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** + * Samples for ResourceProvider CheckNameAvailability. + */ +public final class ResourceProviderCheckNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CheckNameAvailability.json + */ + /** + * Sample code: CheckNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceProviders() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_ENDPOINTS), com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_CheckNameAvailabilityWithSubscription + +```java +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** + * Samples for ResourceProvider CheckNameAvailabilityWithSubscription. + */ +public final class ResourceProviderCheckNameAvailabilityWithSubscriptionSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CheckNameAvailabilityWithSubscription + * .json + */ + /** + * Sample code: CheckNameAvailabilityWithSubscription. + * + * @param manager Entry point to CdnManager. + */ + public static void + checkNameAvailabilityWithSubscription(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceProviders() + .checkNameAvailabilityWithSubscriptionWithResponse(new CheckNameAvailabilityInput().withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_ENDPOINTS), com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_ValidateProbe + +```java +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; + +/** + * Samples for ResourceProvider ValidateProbe. + */ +public final class ResourceProviderValidateProbeSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ValidateProbe.json + */ + /** + * Sample code: ValidateProbe. + * + * @param manager Entry point to CdnManager. + */ + public static void validateProbe(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceProviders() + .validateProbeWithResponse(new ValidateProbeInput().withProbeUrl("https://www.bing.com/image"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceUsage_List + +```java +/** + * Samples for ResourceUsage List. + */ +public final class ResourceUsageListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ResourceUsage_List.json + */ + /** + * Sample code: ResourceUsage_List. + * + * @param manager Entry point to CdnManager. + */ + public static void resourceUsageList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceUsages().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Routes_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.CompressionSettings; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** + * Samples for Routes Create. + */ +public final class RoutesCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_Create.json + */ + /** + * Sample code: Routes_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void routesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes() + .define("route1") + .withExistingAfdEndpoint("RG", "profile1", "endpoint1") + .withCustomDomains(Arrays.asList(new ActivatedResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"))) + .withOriginGroup(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1")) + .withRuleSets(Arrays.asList(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"))) + .withSupportedProtocols(Arrays.asList(AfdEndpointProtocols.HTTPS, AfdEndpointProtocols.HTTP)) + .withPatternsToMatch(Arrays.asList("/*")) + .withCacheConfiguration(new AfdRouteCacheConfiguration() + .withQueryStringCachingBehavior(AfdQueryStringCachingBehavior.IGNORE_SPECIFIED_QUERY_STRINGS) + .withQueryParameters("querystring=test") + .withCompressionSettings(new CompressionSettings() + .withContentTypesToCompress(Arrays.asList("text/html", "application/octet-stream")) + .withIsCompressionEnabled(true))) + .withForwardingProtocol(ForwardingProtocol.MATCH_REQUEST) + .withLinkToDefaultDomain(LinkToDefaultDomain.ENABLED) + .withHttpsRedirect(HttpsRedirect.ENABLED) + .withEnabledState(EnabledState.ENABLED) + .create(); + } +} +``` + +### Routes_Delete + +```java +/** + * Samples for Routes Delete. + */ +public final class RoutesDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_Delete.json + */ + /** + * Sample code: Routes_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void routesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().delete("RG", "profile1", "endpoint1", "route1", com.azure.core.util.Context.NONE); + } +} +``` + +### Routes_Get + +```java +/** + * Samples for Routes Get. + */ +public final class RoutesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_Get.json + */ + /** + * Sample code: Routes_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void routesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().getWithResponse("RG", "profile1", "endpoint1", "route1", com.azure.core.util.Context.NONE); + } +} +``` + +### Routes_ListByEndpoint + +```java +/** + * Samples for Routes ListByEndpoint. + */ +public final class RoutesListByEndpointSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_ListByEndpoint.json + */ + /** + * Sample code: Routes_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void routesListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().listByEndpoint("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### Routes_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.CompressionSettings; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Route; +import java.util.Arrays; + +/** + * Samples for Routes Update. + */ +public final class RoutesUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_Update.json + */ + /** + * Sample code: Routes_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void routesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Route resource = manager.routes() + .getWithResponse("RG", "profile1", "endpoint1", "route1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withCustomDomains(Arrays.asList(new ActivatedResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"))) + .withOriginGroup(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1")) + .withRuleSets(Arrays.asList(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"))) + .withSupportedProtocols(Arrays.asList(AfdEndpointProtocols.HTTPS, AfdEndpointProtocols.HTTP)) + .withPatternsToMatch(Arrays.asList("/*")) + .withCacheConfiguration(new AfdRouteCacheConfiguration() + .withQueryStringCachingBehavior(AfdQueryStringCachingBehavior.IGNORE_QUERY_STRING) + .withCompressionSettings(new CompressionSettings() + .withContentTypesToCompress(Arrays.asList("text/html", "application/octet-stream")) + .withIsCompressionEnabled(true))) + .withForwardingProtocol(ForwardingProtocol.MATCH_REQUEST) + .withLinkToDefaultDomain(LinkToDefaultDomain.ENABLED) + .withHttpsRedirect(HttpsRedirect.ENABLED) + .withEnabledState(EnabledState.ENABLED) + .apply(); + } +} +``` + +### RuleSets_Create + +```java +/** + * Samples for RuleSets Create. + */ +public final class RuleSetsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_Create.json + */ + /** + * Sample code: RuleSets_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().createWithResponse("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} +``` + +### RuleSets_Delete + +```java +/** + * Samples for RuleSets Delete. + */ +public final class RuleSetsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_Delete.json + */ + /** + * Sample code: RuleSets_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().delete("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} +``` + +### RuleSets_Get + +```java +/** + * Samples for RuleSets Get. + */ +public final class RuleSetsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_Get.json + */ + /** + * Sample code: RuleSets_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().getWithResponse("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} +``` + +### RuleSets_ListByProfile + +```java +/** + * Samples for RuleSets ListByProfile. + */ +public final class RuleSetsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_ListByProfile.json + */ + /** + * Sample code: RuleSets_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### RuleSets_ListResourceUsage + +```java +/** + * Samples for RuleSets ListResourceUsage. + */ +public final class RuleSetsListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_ListResourceUsage.json + */ + /** + * Sample code: RuleSets_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().listResourceUsage("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} +``` + +### Rules_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleRequestMethodCondition; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleResponseHeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderActionParameters; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodMatchConditionParameters; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodMatchValue; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodOperator; +import java.util.Arrays; + +/** + * Samples for Rules Create. + */ +public final class RulesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_Create.json + */ + /** + * Sample code: Rules_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules() + .define("rule1") + .withExistingRuleSet("RG", "profile1", "ruleSet1") + .withOrder(1) + .withConditions(Arrays.asList(new DeliveryRuleRequestMethodCondition() + .withParameters(new RequestMethodMatchConditionParameters().withOperator(RequestMethodOperator.EQUAL) + .withNegateCondition(false) + .withMatchValues(Arrays.asList(RequestMethodMatchValue.GET))))) + .withActions(Arrays.asList(new DeliveryRuleResponseHeaderAction() + .withParameters(new HeaderActionParameters().withHeaderAction(HeaderAction.OVERWRITE) + .withHeaderName("X-CDN") + .withValue("MSFT")))) + .create(); + } +} +``` + +### Rules_Delete + +```java +/** + * Samples for Rules Delete. + */ +public final class RulesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_Delete.json + */ + /** + * Sample code: Rules_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().delete("RG", "profile1", "ruleSet1", "rule1", com.azure.core.util.Context.NONE); + } +} +``` + +### Rules_Get + +```java +/** + * Samples for Rules Get. + */ +public final class RulesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_Get.json + */ + /** + * Sample code: Rules_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().getWithResponse("RG", "profile1", "ruleSet1", "rule1", com.azure.core.util.Context.NONE); + } +} +``` + +### Rules_ListByRuleSet + +```java +/** + * Samples for Rules ListByRuleSet. + */ +public final class RulesListByRuleSetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_ListByRuleSet.json + */ + /** + * Sample code: Rules_ListByRuleSet. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesListByRuleSet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().listByRuleSet("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} +``` + +### Rules_Update + +```java +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleResponseHeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderActionParameters; +import com.azure.resourcemanager.cdn.generated.models.Rule; +import java.util.Arrays; + +/** + * Samples for Rules Update. + */ +public final class RulesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_Update.json + */ + /** + * Sample code: Rules_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Rule resource = manager.rules() + .getWithResponse("RG", "profile1", "ruleSet1", "rule1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withOrder(1) + .withActions(Arrays.asList(new DeliveryRuleResponseHeaderAction() + .withParameters(new HeaderActionParameters().withHeaderAction(HeaderAction.OVERWRITE) + .withHeaderName("X-CDN") + .withValue("MSFT")))) + .apply(); + } +} +``` + +### Secrets_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.CustomerCertificateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** + * Samples for Secrets Create. + */ +public final class SecretsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Secrets_Create.json + */ + /** + * Sample code: Secrets_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets() + .define("secret1") + .withExistingProfile("RG", "profile1") + .withParameters(new CustomerCertificateParameters().withSecretSource(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/secrets/certificatename")) + .withSecretVersion("fakeTokenPlaceholder") + .withUseLatestVersion(false)) + .create(); + } +} +``` + +### Secrets_Delete + +```java +/** + * Samples for Secrets Delete. + */ +public final class SecretsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Secrets_Delete.json + */ + /** + * Sample code: Secrets_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().delete("RG", "profile1", "secret1", com.azure.core.util.Context.NONE); + } +} +``` + +### Secrets_Get + +```java +/** + * Samples for Secrets Get. + */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Secrets_Get.json + */ + /** + * Sample code: Secrets_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().getWithResponse("RG", "profile1", "secret1", com.azure.core.util.Context.NONE); + } +} +``` + +### Secrets_ListByProfile + +```java +/** + * Samples for Secrets ListByProfile. + */ +public final class SecretsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Secrets_ListByProfile.json + */ + /** + * Sample code: Secrets_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityPolicies_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallAssociation; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallParameters; +import java.util.Arrays; + +/** + * Samples for SecurityPolicies Create. + */ +public final class SecurityPoliciesCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_Create.json + */ + /** + * Sample code: SecurityPolicies_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies() + .define("securityPolicy1") + .withExistingProfile("RG", "profile1") + .withParameters(new SecurityPolicyWebApplicationFirewallParameters() + .withWafPolicy(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest")) + .withAssociations(Arrays.asList(new SecurityPolicyWebApplicationFirewallAssociation() + .withDomains(Arrays.asList(new ActivatedResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), + new ActivatedResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"))) + .withPatternsToMatch(Arrays.asList("/*"))))) + .create(); + } +} +``` + +### SecurityPolicies_Delete + +```java +/** + * Samples for SecurityPolicies Delete. + */ +public final class SecurityPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_Delete.json + */ + /** + * Sample code: SecurityPolicies_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().delete("RG", "profile1", "securityPolicy1", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityPolicies_Get + +```java +/** + * Samples for SecurityPolicies Get. + */ +public final class SecurityPoliciesGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_Get.json + */ + /** + * Sample code: SecurityPolicies_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies() + .getWithResponse("RG", "profile1", "securityPolicy1", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityPolicies_ListByProfile + +```java +/** + * Samples for SecurityPolicies ListByProfile. + */ +public final class SecurityPoliciesListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_ListByProfile.json + */ + /** + * Sample code: SecurityPolicies_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityPolicies_Patch + +```java +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicy; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallAssociation; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallParameters; +import java.util.Arrays; + +/** + * Samples for SecurityPolicies Patch. + */ +public final class SecurityPoliciesPatchSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_Patch.json + */ + /** + * Sample code: SecurityPolicies_Patch. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesPatch(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + SecurityPolicy resource = manager.securityPolicies() + .getWithResponse("RG", "profile1", "securityPolicy1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withParameters(new SecurityPolicyWebApplicationFirewallParameters() + .withWafPolicy(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest")) + .withAssociations(Arrays.asList(new SecurityPolicyWebApplicationFirewallAssociation() + .withDomains(Arrays.asList(new ActivatedResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), + new ActivatedResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"))) + .withPatternsToMatch(Arrays.asList("/*"))))) + .apply(); + } +} +``` + diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml b/sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml new file mode 100644 index 000000000000..f61e1b76b5e7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-cdn-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Cdn Management + This package contains Microsoft Azure SDK for Cdn Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Cdn Management Client. Package tag package-2024-09. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + false + + + + com.azure + azure-core + 1.55.2 + + + com.azure + azure-core-management + 1.16.2 + + + 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 000000000000..189e8843e544 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/CdnManager.java @@ -0,0 +1,618 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.CdnManagementClient; +import com.azure.resourcemanager.cdn.generated.implementation.AfdCustomDomainsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.AfdEndpointsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.AfdOriginGroupsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.AfdOriginsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.AfdProfilesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.CdnManagementClientBuilder; +import com.azure.resourcemanager.cdn.generated.implementation.CustomDomainsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.EdgeNodesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.EndpointsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.LogAnalyticsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.ManagedRuleSetsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.OriginGroupsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.OriginsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.PoliciesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.ProfilesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.cdn.generated.implementation.ResourceUsagesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.RoutesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.RuleSetsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.RulesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.SecretsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.SecurityPoliciesImpl; +import com.azure.resourcemanager.cdn.generated.models.AfdCustomDomains; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoints; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroups; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigins; +import com.azure.resourcemanager.cdn.generated.models.AfdProfiles; +import com.azure.resourcemanager.cdn.generated.models.CustomDomains; +import com.azure.resourcemanager.cdn.generated.models.EdgeNodes; +import com.azure.resourcemanager.cdn.generated.models.Endpoints; +import com.azure.resourcemanager.cdn.generated.models.LogAnalytics; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSets; +import com.azure.resourcemanager.cdn.generated.models.Operations; +import com.azure.resourcemanager.cdn.generated.models.OriginGroups; +import com.azure.resourcemanager.cdn.generated.models.Origins; +import com.azure.resourcemanager.cdn.generated.models.Policies; +import com.azure.resourcemanager.cdn.generated.models.Profiles; +import com.azure.resourcemanager.cdn.generated.models.ResourceProviders; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsages; +import com.azure.resourcemanager.cdn.generated.models.Routes; +import com.azure.resourcemanager.cdn.generated.models.RuleSets; +import com.azure.resourcemanager.cdn.generated.models.Rules; +import com.azure.resourcemanager.cdn.generated.models.Secrets; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicies; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to CdnManager. + * Cdn Management Client. + */ +public final class CdnManager { + private ResourceProviders resourceProviders; + + private AfdProfiles afdProfiles; + + private AfdCustomDomains afdCustomDomains; + + private AfdEndpoints afdEndpoints; + + private AfdOriginGroups afdOriginGroups; + + private AfdOrigins afdOrigins; + + private Routes routes; + + private RuleSets ruleSets; + + private Rules rules; + + private SecurityPolicies securityPolicies; + + private Secrets secrets; + + private LogAnalytics logAnalytics; + + private Profiles profiles; + + private Endpoints endpoints; + + private Origins origins; + + private OriginGroups originGroups; + + private CustomDomains customDomains; + + private ResourceUsages resourceUsages; + + private Operations operations; + + private EdgeNodes edgeNodes; + + private Policies policies; + + private ManagedRuleSets managedRuleSets; + + private final CdnManagementClient clientObject; + + private CdnManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new CdnManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Cdn service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Cdn service API instance. + */ + public static CdnManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Cdn service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Cdn service API instance. + */ + public static CdnManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new CdnManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create CdnManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new CdnManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-cdn-generated.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Cdn service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Cdn service API instance. + */ + public CdnManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.cdn.generated") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new CdnManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of AfdProfiles. + * + * @return Resource collection API of AfdProfiles. + */ + public AfdProfiles afdProfiles() { + if (this.afdProfiles == null) { + this.afdProfiles = new AfdProfilesImpl(clientObject.getAfdProfiles(), this); + } + return afdProfiles; + } + + /** + * Gets the resource collection API of AfdCustomDomains. It manages AfdDomain. + * + * @return Resource collection API of AfdCustomDomains. + */ + public AfdCustomDomains afdCustomDomains() { + if (this.afdCustomDomains == null) { + this.afdCustomDomains = new AfdCustomDomainsImpl(clientObject.getAfdCustomDomains(), this); + } + return afdCustomDomains; + } + + /** + * Gets the resource collection API of AfdEndpoints. It manages AfdEndpoint. + * + * @return Resource collection API of AfdEndpoints. + */ + public AfdEndpoints afdEndpoints() { + if (this.afdEndpoints == null) { + this.afdEndpoints = new AfdEndpointsImpl(clientObject.getAfdEndpoints(), this); + } + return afdEndpoints; + } + + /** + * Gets the resource collection API of AfdOriginGroups. It manages AfdOriginGroup. + * + * @return Resource collection API of AfdOriginGroups. + */ + public AfdOriginGroups afdOriginGroups() { + if (this.afdOriginGroups == null) { + this.afdOriginGroups = new AfdOriginGroupsImpl(clientObject.getAfdOriginGroups(), this); + } + return afdOriginGroups; + } + + /** + * Gets the resource collection API of AfdOrigins. It manages AfdOrigin. + * + * @return Resource collection API of AfdOrigins. + */ + public AfdOrigins afdOrigins() { + if (this.afdOrigins == null) { + this.afdOrigins = new AfdOriginsImpl(clientObject.getAfdOrigins(), this); + } + return afdOrigins; + } + + /** + * Gets the resource collection API of Routes. It manages Route. + * + * @return Resource collection API of Routes. + */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(clientObject.getRoutes(), this); + } + return routes; + } + + /** + * Gets the resource collection API of RuleSets. + * + * @return Resource collection API of RuleSets. + */ + public RuleSets ruleSets() { + if (this.ruleSets == null) { + this.ruleSets = new RuleSetsImpl(clientObject.getRuleSets(), this); + } + return ruleSets; + } + + /** + * Gets the resource collection API of Rules. It manages Rule. + * + * @return Resource collection API of Rules. + */ + public Rules rules() { + if (this.rules == null) { + this.rules = new RulesImpl(clientObject.getRules(), this); + } + return rules; + } + + /** + * Gets the resource collection API of SecurityPolicies. It manages SecurityPolicy. + * + * @return Resource collection API of SecurityPolicies. + */ + public SecurityPolicies securityPolicies() { + if (this.securityPolicies == null) { + this.securityPolicies = new SecurityPoliciesImpl(clientObject.getSecurityPolicies(), this); + } + return securityPolicies; + } + + /** + * Gets the resource collection API of Secrets. It manages Secret. + * + * @return Resource collection API of Secrets. + */ + public Secrets secrets() { + if (this.secrets == null) { + this.secrets = new SecretsImpl(clientObject.getSecrets(), this); + } + return secrets; + } + + /** + * Gets the resource collection API of LogAnalytics. + * + * @return Resource collection API of LogAnalytics. + */ + public LogAnalytics logAnalytics() { + if (this.logAnalytics == null) { + this.logAnalytics = new LogAnalyticsImpl(clientObject.getLogAnalytics(), this); + } + return logAnalytics; + } + + /** + * Gets the resource collection API of Profiles. It manages Profile. + * + * @return Resource collection API of Profiles. + */ + public Profiles profiles() { + if (this.profiles == null) { + this.profiles = new ProfilesImpl(clientObject.getProfiles(), this); + } + return profiles; + } + + /** + * Gets the resource collection API of Endpoints. It manages Endpoint. + * + * @return Resource collection API of Endpoints. + */ + public Endpoints endpoints() { + if (this.endpoints == null) { + this.endpoints = new EndpointsImpl(clientObject.getEndpoints(), this); + } + return endpoints; + } + + /** + * Gets the resource collection API of Origins. It manages Origin. + * + * @return Resource collection API of Origins. + */ + public Origins origins() { + if (this.origins == null) { + this.origins = new OriginsImpl(clientObject.getOrigins(), this); + } + return origins; + } + + /** + * Gets the resource collection API of OriginGroups. It manages OriginGroup. + * + * @return Resource collection API of OriginGroups. + */ + public OriginGroups originGroups() { + if (this.originGroups == null) { + this.originGroups = new OriginGroupsImpl(clientObject.getOriginGroups(), this); + } + return originGroups; + } + + /** + * Gets the resource collection API of CustomDomains. It manages CustomDomain. + * + * @return Resource collection API of CustomDomains. + */ + public CustomDomains customDomains() { + if (this.customDomains == null) { + this.customDomains = new CustomDomainsImpl(clientObject.getCustomDomains(), this); + } + return customDomains; + } + + /** + * Gets the resource collection API of ResourceUsages. + * + * @return Resource collection API of ResourceUsages. + */ + public ResourceUsages resourceUsages() { + if (this.resourceUsages == null) { + this.resourceUsages = new ResourceUsagesImpl(clientObject.getResourceUsages(), this); + } + return resourceUsages; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of EdgeNodes. + * + * @return Resource collection API of EdgeNodes. + */ + public EdgeNodes edgeNodes() { + if (this.edgeNodes == null) { + this.edgeNodes = new EdgeNodesImpl(clientObject.getEdgeNodes(), this); + } + return edgeNodes; + } + + /** + * Gets the resource collection API of Policies. It manages CdnWebApplicationFirewallPolicy. + * + * @return Resource collection API of Policies. + */ + public Policies policies() { + if (this.policies == null) { + this.policies = new PoliciesImpl(clientObject.getPolicies(), this); + } + return policies; + } + + /** + * Gets the resource collection API of ManagedRuleSets. + * + * @return Resource collection API of ManagedRuleSets. + */ + public ManagedRuleSets managedRuleSets() { + if (this.managedRuleSets == null) { + this.managedRuleSets = new ManagedRuleSetsImpl(clientObject.getManagedRuleSets(), this); + } + return managedRuleSets; + } + + /** + * Gets wrapped service client CdnManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client CdnManagementClient. + */ + 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 000000000000..8e3cb9f39141 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdCustomDomainsClient.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in AfdCustomDomainsClient. + */ +public interface AfdCustomDomainsClient { + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String customDomainName, + Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner get(String resourceGroupName, String profileName, String customDomainName); + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdDomainInner> beginCreate(String resourceGroupName, String profileName, + String customDomainName, AfdDomainInner customDomain); + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdDomainInner> beginCreate(String resourceGroupName, String profileName, + String customDomainName, AfdDomainInner customDomain, Context context); + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner create(String resourceGroupName, String profileName, String customDomainName, + AfdDomainInner customDomain); + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner create(String resourceGroupName, String profileName, String customDomainName, + AfdDomainInner customDomain, Context context); + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdDomainInner> beginUpdate(String resourceGroupName, String profileName, + String customDomainName, AfdDomainUpdateParameters customDomainUpdateProperties); + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdDomainInner> beginUpdate(String resourceGroupName, String profileName, + String customDomainName, AfdDomainUpdateParameters customDomainUpdateProperties, Context context); + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner update(String resourceGroupName, String profileName, String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties); + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner update(String resourceGroupName, String profileName, String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, Context context); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String customDomainName); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String customDomainName, Context context); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String customDomainName); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String customDomainName, Context context); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRefreshValidationToken(String resourceGroupName, String profileName, + String customDomainName); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRefreshValidationToken(String resourceGroupName, String profileName, + String customDomainName, Context context); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void refreshValidationToken(String resourceGroupName, String profileName, String customDomainName); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void refreshValidationToken(String resourceGroupName, String profileName, String customDomainName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdEndpointsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdEndpointsClient.java new file mode 100644 index 000000000000..f65226b384c0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdEndpointsClient.java @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** + * An instance of this class provides access to all the operations defined in AfdEndpointsClient. + */ +public interface AfdEndpointsClient { + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner get(String resourceGroupName, String profileName, String endpointName); + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdEndpointInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, AfdEndpointInner endpointParam); + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdEndpointInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, AfdEndpointInner endpointParam, Context context); + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner create(String resourceGroupName, String profileName, String endpointName, + AfdEndpointInner endpointParam); + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner create(String resourceGroupName, String profileName, String endpointName, + AfdEndpointInner endpointParam, Context context); + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdEndpointInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, AfdEndpointUpdateParameters endpointUpdateProperties); + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdEndpointInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, AfdEndpointUpdateParameters endpointUpdateProperties, Context context); + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner update(String resourceGroupName, String profileName, String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties); + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner update(String resourceGroupName, String profileName, String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, Context context); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurgeContent(String resourceGroupName, String profileName, + String endpointName, AfdPurgeParameters contents); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurgeContent(String resourceGroupName, String profileName, + String endpointName, AfdPurgeParameters contents, Context context); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purgeContent(String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purgeContent(String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents, + Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateCustomDomainWithResponse(String resourceGroupName, + String profileName, String endpointName, ValidateCustomDomainInput customDomainProperties, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateCustomDomainOutputInner validateCustomDomain(String resourceGroupName, String profileName, + String endpointName, ValidateCustomDomainInput customDomainProperties); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginGroupsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginGroupsClient.java new file mode 100644 index 000000000000..8ae6cab95ad1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginGroupsClient.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroupUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in AfdOriginGroupsClient. + */ +public interface AfdOriginGroupsClient { + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String originGroupName, + Context context); + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner get(String resourceGroupName, String profileName, String originGroupName); + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginGroupInner> beginCreate(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupInner originGroup); + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginGroupInner> beginCreate(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupInner originGroup, Context context); + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner create(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupInner originGroup); + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner create(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupInner originGroup, Context context); + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginGroupInner> beginUpdate(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupUpdateParameters originGroupUpdateProperties); + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginGroupInner> beginUpdate(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupUpdateParameters originGroupUpdateProperties, + Context context); + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner update(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties); + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner update(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, Context context); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String originGroupName); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String originGroupName, + Context context); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String originGroupName); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String originGroupName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String originGroupName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String originGroupName, + Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginsClient.java new file mode 100644 index 000000000000..5a687cf28bd1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginsClient.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in AfdOriginsClient. + */ +public interface AfdOriginsClient { + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOriginGroup(String resourceGroupName, String profileName, + String originGroupName); + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOriginGroup(String resourceGroupName, String profileName, + String originGroupName, Context context); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String originGroupName, + String originName, Context context); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner get(String resourceGroupName, String profileName, String originGroupName, String originName); + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginInner> beginCreate(String resourceGroupName, String profileName, + String originGroupName, String originName, AfdOriginInner origin); + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginInner> beginCreate(String resourceGroupName, String profileName, + String originGroupName, String originName, AfdOriginInner origin, Context context); + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner create(String resourceGroupName, String profileName, String originGroupName, String originName, + AfdOriginInner origin); + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner create(String resourceGroupName, String profileName, String originGroupName, String originName, + AfdOriginInner origin, Context context); + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginInner> beginUpdate(String resourceGroupName, String profileName, + String originGroupName, String originName, AfdOriginUpdateParameters originUpdateProperties); + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginInner> beginUpdate(String resourceGroupName, String profileName, + String originGroupName, String originName, AfdOriginUpdateParameters originUpdateProperties, Context context); + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner update(String resourceGroupName, String profileName, String originGroupName, String originName, + AfdOriginUpdateParameters originUpdateProperties); + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner update(String resourceGroupName, String profileName, String originGroupName, String originName, + AfdOriginUpdateParameters originUpdateProperties, Context context); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String originGroupName, + String originName); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String originGroupName, + String originName, Context context); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String originGroupName, String originName); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String originGroupName, String originName, + Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdProfilesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdProfilesClient.java new file mode 100644 index 000000000000..e0d2ab28b435 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdProfilesClient.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.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.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; + +/** + * An instance of this class provides access to all the operations defined in AfdProfilesClient. + */ +public interface AfdProfilesClient { + /** + * Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, String profileName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, Context context); + + /** + * Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckEndpointNameAvailabilityOutputInner checkEndpointNameAvailability(String resourceGroupName, String profileName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkHostnameAvailabilityWithResponse(String resourceGroupName, + String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityOutputInner checkHostnameAvailability(String resourceGroupName, String profileName, + CheckHostnameAvailabilityInput checkHostnameAvailabilityInput); + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateSecretWithResponse(String resourceGroupName, String profileName, + ValidateSecretInput validateSecretInput, Context context); + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateSecretOutputInner validateSecret(String resourceGroupName, String profileName, + ValidateSecretInput validateSecretInput); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginUpgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginUpgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters, Context context); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner upgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner upgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CdnManagementClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CdnManagementClient.java new file mode 100644 index 000000000000..b00c0097b23c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CdnManagementClient.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for CdnManagementClient class. + */ +public interface CdnManagementClient { + /** + * Gets Azure Subscription ID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the AfdProfilesClient object to access its operations. + * + * @return the AfdProfilesClient object. + */ + AfdProfilesClient getAfdProfiles(); + + /** + * Gets the AfdCustomDomainsClient object to access its operations. + * + * @return the AfdCustomDomainsClient object. + */ + AfdCustomDomainsClient getAfdCustomDomains(); + + /** + * Gets the AfdEndpointsClient object to access its operations. + * + * @return the AfdEndpointsClient object. + */ + AfdEndpointsClient getAfdEndpoints(); + + /** + * Gets the AfdOriginGroupsClient object to access its operations. + * + * @return the AfdOriginGroupsClient object. + */ + AfdOriginGroupsClient getAfdOriginGroups(); + + /** + * Gets the AfdOriginsClient object to access its operations. + * + * @return the AfdOriginsClient object. + */ + AfdOriginsClient getAfdOrigins(); + + /** + * Gets the RoutesClient object to access its operations. + * + * @return the RoutesClient object. + */ + RoutesClient getRoutes(); + + /** + * Gets the RuleSetsClient object to access its operations. + * + * @return the RuleSetsClient object. + */ + RuleSetsClient getRuleSets(); + + /** + * Gets the RulesClient object to access its operations. + * + * @return the RulesClient object. + */ + RulesClient getRules(); + + /** + * Gets the SecurityPoliciesClient object to access its operations. + * + * @return the SecurityPoliciesClient object. + */ + SecurityPoliciesClient getSecurityPolicies(); + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + SecretsClient getSecrets(); + + /** + * Gets the LogAnalyticsClient object to access its operations. + * + * @return the LogAnalyticsClient object. + */ + LogAnalyticsClient getLogAnalytics(); + + /** + * Gets the ProfilesClient object to access its operations. + * + * @return the ProfilesClient object. + */ + ProfilesClient getProfiles(); + + /** + * Gets the EndpointsClient object to access its operations. + * + * @return the EndpointsClient object. + */ + EndpointsClient getEndpoints(); + + /** + * Gets the OriginsClient object to access its operations. + * + * @return the OriginsClient object. + */ + OriginsClient getOrigins(); + + /** + * Gets the OriginGroupsClient object to access its operations. + * + * @return the OriginGroupsClient object. + */ + OriginGroupsClient getOriginGroups(); + + /** + * Gets the CustomDomainsClient object to access its operations. + * + * @return the CustomDomainsClient object. + */ + CustomDomainsClient getCustomDomains(); + + /** + * Gets the ResourceUsagesClient object to access its operations. + * + * @return the ResourceUsagesClient object. + */ + ResourceUsagesClient getResourceUsages(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the EdgeNodesClient object to access its operations. + * + * @return the EdgeNodesClient object. + */ + EdgeNodesClient getEdgeNodes(); + + /** + * Gets the PoliciesClient object to access its operations. + * + * @return the PoliciesClient object. + */ + PoliciesClient getPolicies(); + + /** + * Gets the ManagedRuleSetsClient object to access its operations. + * + * @return the ManagedRuleSetsClient object. + */ + ManagedRuleSetsClient getManagedRuleSets(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CustomDomainsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CustomDomainsClient.java new file mode 100644 index 000000000000..aaef40152d6b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CustomDomainsClient.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainParameters; + +/** + * An instance of this class provides access to all the operations defined in CustomDomainsClient. + */ +public interface CustomDomainsClient { + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner get(String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, String customDomainName, + CustomDomainParameters customDomainProperties); + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, String customDomainName, CustomDomainParameters customDomainProperties, + Context context); + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner create(String resourceGroupName, String profileName, String endpointName, String customDomainName, + CustomDomainParameters customDomainProperties); + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner create(String resourceGroupName, String profileName, String endpointName, String customDomainName, + CustomDomainParameters customDomainProperties, Context context); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginDelete(String resourceGroupName, + String profileName, String endpointName, String customDomainName); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginDelete(String resourceGroupName, + String profileName, String endpointName, String customDomainName, Context context); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner delete(String resourceGroupName, String profileName, String endpointName, + String customDomainName); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner delete(String resourceGroupName, String profileName, String endpointName, String customDomainName, + Context context); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginDisableCustomHttps(String resourceGroupName, + String profileName, String endpointName, String customDomainName); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginDisableCustomHttps(String resourceGroupName, + String profileName, String endpointName, String customDomainName, Context context); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner disableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner disableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginEnableCustomHttps(String resourceGroupName, + String profileName, String endpointName, String customDomainName); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginEnableCustomHttps(String resourceGroupName, + String profileName, String endpointName, String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, Context context); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner enableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner enableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EdgeNodesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EdgeNodesClient.java new file mode 100644 index 000000000000..5fd02b1cd68e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EdgeNodesClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; + +/** + * An instance of this class provides access to all the operations defined in EdgeNodesClient. + */ +public interface EdgeNodesClient { + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EndpointsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EndpointsClient.java new file mode 100644 index 000000000000..789190752488 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EndpointsClient.java @@ -0,0 +1,635 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.EndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** + * An instance of this class provides access to all the operations defined in EndpointsClient. + */ +public interface EndpointsClient { + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner get(String resourceGroupName, String profileName, String endpointName); + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, EndpointInner endpointParam); + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, EndpointInner endpointParam, Context context); + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner create(String resourceGroupName, String profileName, String endpointName, + EndpointInner endpointParam); + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner create(String resourceGroupName, String profileName, String endpointName, EndpointInner endpointParam, + Context context); + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, EndpointUpdateParameters endpointUpdateProperties); + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, EndpointUpdateParameters endpointUpdateProperties, Context context); + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner update(String resourceGroupName, String profileName, String endpointName, + EndpointUpdateParameters endpointUpdateProperties); + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner update(String resourceGroupName, String profileName, String endpointName, + EndpointUpdateParameters endpointUpdateProperties, Context context); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginStart(String resourceGroupName, String profileName, + String endpointName); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginStart(String resourceGroupName, String profileName, + String endpointName, Context context); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner start(String resourceGroupName, String profileName, String endpointName); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner start(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginStop(String resourceGroupName, String profileName, + String endpointName); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginStop(String resourceGroupName, String profileName, + String endpointName, Context context); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner stop(String resourceGroupName, String profileName, String endpointName); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner stop(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurgeContent(String resourceGroupName, String profileName, + String endpointName, PurgeParameters contentFilePaths); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurgeContent(String resourceGroupName, String profileName, + String endpointName, PurgeParameters contentFilePaths, Context context); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purgeContent(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purgeContent(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths, Context context); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginLoadContent(String resourceGroupName, String profileName, + String endpointName, LoadParameters contentFilePaths); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginLoadContent(String resourceGroupName, String profileName, + String endpointName, LoadParameters contentFilePaths, Context context); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void loadContent(String resourceGroupName, String profileName, String endpointName, + LoadParameters contentFilePaths); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void loadContent(String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateCustomDomainWithResponse(String resourceGroupName, + String profileName, String endpointName, ValidateCustomDomainInput customDomainProperties, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateCustomDomainOutputInner validateCustomDomain(String resourceGroupName, String profileName, + String endpointName, ValidateCustomDomainInput customDomainProperties); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String endpointName); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String endpointName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/LogAnalyticsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/LogAnalyticsClient.java new file mode 100644 index 000000000000..1e3e9da3022b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/LogAnalyticsClient.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.ContinentsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafRankingGroupBy; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import com.azure.resourcemanager.cdn.generated.models.WafRuleType; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined in LogAnalyticsClient. + */ +public interface LogAnalyticsClient { + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains The customDomains parameter. + * @param protocols The protocols parameter. + * @param groupBy The groupBy parameter. + * @param continents The continents parameter. + * @param countryOrRegions The countryOrRegions parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsMetricsWithResponse(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, List customDomains, List protocols, + List groupBy, List continents, List countryOrRegions, Context context); + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains The customDomains parameter. + * @param protocols The protocols 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 report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MetricsResponseInner getLogAnalyticsMetrics(String resourceGroupName, String profileName, List metrics, + OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, LogMetricsGranularity granularity, + List customDomains, List protocols); + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings The rankings parameter. + * @param metrics The metrics parameter. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains The customDomains parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsRankingsWithResponse(String resourceGroupName, String profileName, + List rankings, List metrics, int maxRanking, OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, List customDomains, Context context); + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings The rankings parameter. + * @param metrics The metrics parameter. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RankingsResponseInner getLogAnalyticsRankings(String resourceGroupName, String profileName, + List rankings, List metrics, int maxRanking, OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd); + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsLocationsWithResponse(String resourceGroupName, String profileName, + Context context); + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContinentsResponseInner getLogAnalyticsLocations(String resourceGroupName, String profileName); + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsResourcesWithResponse(String resourceGroupName, String profileName, + Context context); + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourcesResponseInner getLogAnalyticsResources(String resourceGroupName, String profileName); + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions The actions parameter. + * @param groupBy The groupBy parameter. + * @param ruleTypes The ruleTypes parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWafLogAnalyticsMetricsWithResponse(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + WafGranularity granularity, List actions, List groupBy, + List ruleTypes, Context context); + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WafMetricsResponseInner getWafLogAnalyticsMetrics(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, WafGranularity granularity); + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings The rankings parameter. + * @param actions The actions parameter. + * @param ruleTypes The ruleTypes parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wAF log analytics charts for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWafLogAnalyticsRankingsWithResponse(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + int maxRanking, List rankings, List actions, List ruleTypes, + Context context); + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings The rankings 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 log analytics charts for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WafRankingsResponseInner getWafLogAnalyticsRankings(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, int maxRanking, + List rankings); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ManagedRuleSetsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ManagedRuleSetsClient.java new file mode 100644 index 000000000000..f114dcec83b9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ManagedRuleSetsClient.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.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; + +/** + * An instance of this class provides access to all the operations defined in ManagedRuleSetsClient. + */ +public interface ManagedRuleSetsClient { + /** + * Lists all available managed rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all available managed rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OperationsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OperationsClient.java new file mode 100644 index 000000000000..d7a8cc46db37 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * Lists all of the available CDN REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginGroupsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginGroupsClient.java new file mode 100644 index 000000000000..7de941a4fa72 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginGroupsClient.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in OriginGroupsClient. + */ +public interface OriginGroupsClient { + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String originGroupName, Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner get(String resourceGroupName, String profileName, String endpointName, String originGroupName); + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginGroupInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String originGroupName, OriginGroupInner originGroup); + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginGroupInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String originGroupName, OriginGroupInner originGroup, Context context); + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner create(String resourceGroupName, String profileName, String endpointName, String originGroupName, + OriginGroupInner originGroup); + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner create(String resourceGroupName, String profileName, String endpointName, String originGroupName, + OriginGroupInner originGroup, Context context); + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginGroupInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String originGroupName, OriginGroupUpdateParameters originGroupUpdateProperties); + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginGroupInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String originGroupName, OriginGroupUpdateParameters originGroupUpdateProperties, + Context context); + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner update(String resourceGroupName, String profileName, String endpointName, String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties); + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner update(String resourceGroupName, String profileName, String endpointName, String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, Context context); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName, + String originGroupName); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName, + String originGroupName, Context context); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName, String originGroupName); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName, String originGroupName, + Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginsClient.java new file mode 100644 index 000000000000..4a648b7468fd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginsClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.azure.resourcemanager.cdn.generated.models.OriginUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in OriginsClient. + */ +public interface OriginsClient { + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String originName, Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner get(String resourceGroupName, String profileName, String endpointName, String originName); + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String originName, OriginInner origin); + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String originName, OriginInner origin, Context context); + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner create(String resourceGroupName, String profileName, String endpointName, String originName, + OriginInner origin); + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner create(String resourceGroupName, String profileName, String endpointName, String originName, + OriginInner origin, Context context); + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String originName, OriginUpdateParameters originUpdateProperties); + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String originName, OriginUpdateParameters originUpdateProperties, Context context); + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner update(String resourceGroupName, String profileName, String endpointName, String originName, + OriginUpdateParameters originUpdateProperties); + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner update(String resourceGroupName, String profileName, String endpointName, String originName, + OriginUpdateParameters originUpdateProperties, Context context); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName, + String originName); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName, + String originName, Context context); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName, String originName); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName, String originName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/PoliciesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/PoliciesClient.java new file mode 100644 index 000000000000..03f2e2705d7f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/PoliciesClient.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicyPatchParameters; + +/** + * An instance of this class provides access to all the operations defined in PoliciesClient. + */ +public interface PoliciesClient { + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String policyName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy); + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, Context context); + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner createOrUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy); + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner createOrUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, Context context); + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CdnWebApplicationFirewallPolicyInner> beginUpdate( + String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters); + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CdnWebApplicationFirewallPolicyInner> beginUpdate( + String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, Context context); + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner update(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters); + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner update(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String policyName, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String policyName); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ProfilesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ProfilesClient.java new file mode 100644 index 000000000000..1bfbb7f7c63d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ProfilesClient.java @@ -0,0 +1,766 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.CdnMigrationToAfdParameters; +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in ProfilesClient. + */ +public interface ProfilesClient { + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String profileName, + Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner getByResourceGroup(String resourceGroupName, String profileName); + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginCreate(String resourceGroupName, String profileName, + ProfileInner profile); + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginCreate(String resourceGroupName, String profileName, + ProfileInner profile, Context context); + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile); + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile, Context context); + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginUpdate(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters); + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginUpdate(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters, Context context); + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner update(String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters); + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner update(String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters, + Context context); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, Context context); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CanMigrateResultInner> beginCanMigrate(String resourceGroupName, + CanMigrateParameters canMigrateParameters); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CanMigrateResultInner> beginCanMigrate(String resourceGroupName, + CanMigrateParameters canMigrateParameters, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CanMigrateResultInner canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CanMigrateResultInner canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters, + Context context); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrateResultInner> beginMigrate(String resourceGroupName, + MigrationParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrateResultInner> beginMigrate(String resourceGroupName, + MigrationParameters migrationParameters, Context context); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrateResultInner migrate(String resourceGroupName, MigrationParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrateResultInner migrate(String resourceGroupName, MigrationParameters migrationParameters, Context context); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginMigrationCommit(String resourceGroupName, String profileName); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginMigrationCommit(String resourceGroupName, String profileName, + Context context); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void migrationCommit(String resourceGroupName, String profileName); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void migrationCommit(String resourceGroupName, String profileName, Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateSsoUriWithResponse(String resourceGroupName, String profileName, Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsoUriInner generateSsoUri(String resourceGroupName, String profileName); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + listSupportedOptimizationTypesWithResponse(String resourceGroupName, String profileName, Context context); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportedOptimizationTypesListResultInner listSupportedOptimizationTypes(String resourceGroupName, + String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CanMigrateResultInner> + beginCdnCanMigrateToAfd(String resourceGroupName, String profileName); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CanMigrateResultInner> + beginCdnCanMigrateToAfd(String resourceGroupName, String profileName, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CanMigrateResultInner cdnCanMigrateToAfd(String resourceGroupName, String profileName); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CanMigrateResultInner cdnCanMigrateToAfd(String resourceGroupName, String profileName, Context context); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrateResultInner> beginCdnMigrateToAfd(String resourceGroupName, + String profileName, CdnMigrationToAfdParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrateResultInner> beginCdnMigrateToAfd(String resourceGroupName, + String profileName, CdnMigrationToAfdParameters migrationParameters, Context context); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrateResultInner cdnMigrateToAfd(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrateResultInner cdnMigrateToAfd(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters, Context context); + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginMigrationAbort(String resourceGroupName, String profileName); + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginMigrationAbort(String resourceGroupName, String profileName, + Context context); + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 migrationAbort(String resourceGroupName, String profileName); + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 migrationAbort(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 000000000000..53019358adc8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceProvidersClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; + +/** + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. + */ +public interface ResourceProvidersClient { + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckEndpointNameAvailabilityOutputInner checkEndpointNameAvailability(String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityOutputInner checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityOutputInner + checkNameAvailabilityWithSubscription(CheckNameAvailabilityInput checkNameAvailabilityInput); + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateProbeWithResponse(ValidateProbeInput validateProbeInput, + Context context); + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateProbeOutputInner validateProbe(ValidateProbeInput validateProbeInput); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceUsagesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceUsagesClient.java new file mode 100644 index 000000000000..4acd4aaf746f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceUsagesClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; + +/** + * An instance of this class provides access to all the operations defined in ResourceUsagesClient. + */ +public interface ResourceUsagesClient { + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RoutesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RoutesClient.java new file mode 100644 index 000000000000..84d7ac5ce4b5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RoutesClient.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.cdn.generated.models.RouteUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in RoutesClient. + */ +public interface RoutesClient { + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String routeName, Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner get(String resourceGroupName, String profileName, String endpointName, String routeName); + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteInner route); + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteInner route, Context context); + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner create(String resourceGroupName, String profileName, String endpointName, String routeName, + RouteInner route); + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner create(String resourceGroupName, String profileName, String endpointName, String routeName, + RouteInner route, Context context); + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteUpdateParameters routeUpdateProperties); + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteUpdateParameters routeUpdateProperties, Context context); + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner update(String resourceGroupName, String profileName, String endpointName, String routeName, + RouteUpdateParameters routeUpdateProperties); + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner update(String resourceGroupName, String profileName, String endpointName, String routeName, + RouteUpdateParameters routeUpdateProperties, Context context); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName, + String routeName); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String endpointName, + String routeName, Context context); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName, String routeName); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String endpointName, String routeName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RuleSetsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RuleSetsClient.java new file mode 100644 index 000000000000..17dafc31b627 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RuleSetsClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; + +/** + * An instance of this class provides access to all the operations defined in RuleSetsClient. + */ +public interface RuleSetsClient { + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String ruleSetName, + Context context); + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleSetInner get(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String profileName, String ruleSetName, + Context context); + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleSetInner create(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String ruleSetName, + Context context); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String ruleSetName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName, + Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RulesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RulesClient.java new file mode 100644 index 000000000000..db2e0bebd234 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RulesClient.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.cdn.generated.models.RuleUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in RulesClient. + */ +public interface RulesClient { + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName, + Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String ruleSetName, + String ruleName, Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner get(String resourceGroupName, String profileName, String ruleSetName, String ruleName); + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RuleInner> beginCreate(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleInner rule); + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RuleInner> beginCreate(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleInner rule, Context context); + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner create(String resourceGroupName, String profileName, String ruleSetName, String ruleName, RuleInner rule); + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner create(String resourceGroupName, String profileName, String ruleSetName, String ruleName, RuleInner rule, + Context context); + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RuleInner> beginUpdate(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleUpdateParameters ruleUpdateProperties); + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RuleInner> beginUpdate(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleUpdateParameters ruleUpdateProperties, Context context); + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner update(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + RuleUpdateParameters ruleUpdateProperties); + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner update(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + RuleUpdateParameters ruleUpdateProperties, Context context); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String ruleSetName, + String ruleName); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String ruleSetName, + String ruleName, Context context); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String ruleSetName, String ruleName); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String ruleSetName, String ruleName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecretsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecretsClient.java new file mode 100644 index 000000000000..92579df92011 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecretsClient.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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; + +/** + * An instance of this class provides access to all the operations defined in SecretsClient. + */ +public interface SecretsClient { + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, String secretName, + Context context); + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner get(String resourceGroupName, String profileName, String secretName); + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretInner> beginCreate(String resourceGroupName, String profileName, + String secretName, SecretInner secret); + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretInner> beginCreate(String resourceGroupName, String profileName, + String secretName, SecretInner secret, Context context); + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner create(String resourceGroupName, String profileName, String secretName, SecretInner secret); + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner create(String resourceGroupName, String profileName, String secretName, SecretInner secret, + Context context); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String secretName); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String secretName, + Context context); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String secretName); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String secretName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecurityPoliciesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecurityPoliciesClient.java new file mode 100644 index 000000000000..0828a3b9eda1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecurityPoliciesClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in SecurityPoliciesClient. + */ +public interface SecurityPoliciesClient { + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String profileName, + String securityPolicyName, Context context); + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner get(String resourceGroupName, String profileName, String securityPolicyName); + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecurityPolicyInner> beginCreate(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy); + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecurityPolicyInner> beginCreate(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy, Context context); + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner create(String resourceGroupName, String profileName, String securityPolicyName, + SecurityPolicyInner securityPolicy); + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner create(String resourceGroupName, String profileName, String securityPolicyName, + SecurityPolicyInner securityPolicy, Context context); + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecurityPolicyInner> beginPatch(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties); + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecurityPolicyInner> beginPatch(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + Context context); + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner patch(String resourceGroupName, String profileName, String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties); + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner patch(String resourceGroupName, String profileName, String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties, Context context); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String securityPolicyName); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String securityPolicyName, Context context); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String securityPolicyName); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, String securityPolicyName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainInner.java new file mode 100644 index 000000000000..b05c2b6a4174 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainInner.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.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 java.io.IOException; +import java.util.Map; + +/** + * Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. + * www.contoso.com. + */ +@Fluent +public final class AfdDomainInner extends ProxyResource { + /* + * The JSON object that contains the properties of the domain to create. + */ + private AfdDomainProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AfdDomainInner class. + */ + public AfdDomainInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the domain to create. + * + * @return the innerProperties value. + */ + private AfdDomainProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the domainValidationState property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. DCV stands for DomainControlValidation. + * + * @return the domainValidationState value. + */ + public DomainValidationState domainValidationState() { + return this.innerProperties() == null ? null : this.innerProperties().domainValidationState(); + } + + /** + * Get the hostname property: The host name of the domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host name of the domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); + } + + /** + * Set the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @param extendedProperties the extendedProperties value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withExtendedProperties(Map extendedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withExtendedProperties(extendedProperties); + return this; + } + + /** + * Get the validationProperties property: Values the customer needs to validate domain ownership. + * + * @return the validationProperties value. + */ + public DomainValidationProperties validationProperties() { + return this.innerProperties() == null ? null : this.innerProperties().validationProperties(); + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the profileName property: The name of the profile which holds the domain. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @return the tlsSettings value. + */ + public AfdDomainHttpsParameters tlsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().tlsSettings(); + } + + /** + * Set the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @param tlsSettings the tlsSettings value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withTlsSettings(tlsSettings); + return this; + } + + /** + * Get the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @return the azureDnsZone value. + */ + public ResourceReference azureDnsZone() { + return this.innerProperties() == null ? null : this.innerProperties().azureDnsZone(); + } + + /** + * Set the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone the azureDnsZone value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withAzureDnsZone(ResourceReference azureDnsZone) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withAzureDnsZone(azureDnsZone); + return this; + } + + /** + * Get the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @return the preValidatedCustomDomainResourceId value. + */ + public ResourceReference preValidatedCustomDomainResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().preValidatedCustomDomainResourceId(); + } + + /** + * Set the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId the preValidatedCustomDomainResourceId value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdDomainInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdDomainInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AfdDomainInner. + */ + public static AfdDomainInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdDomainInner deserializedAfdDomainInner = new AfdDomainInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAfdDomainInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAfdDomainInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAfdDomainInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAfdDomainInner.innerProperties = AfdDomainProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAfdDomainInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdDomainInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainProperties.java new file mode 100644 index 000000000000..0300ab0461e9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainProperties.java @@ -0,0 +1,273 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.Map; + +/** + * The JSON object that contains the properties of the domain to create. + */ +@Fluent +public final class AfdDomainProperties extends AfdDomainUpdatePropertiesParameters { + /* + * Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. DCV stands for + * DomainControlValidation. + */ + private DomainValidationState domainValidationState; + + /* + * The host name of the domain. Must be a domain name. + */ + private String hostname; + + /* + * Key-Value pair representing migration properties for domains. + */ + private Map extendedProperties; + + /* + * Values the customer needs to validate domain ownership + */ + private DomainValidationProperties validationProperties; + + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /* + * The name of the profile which holds the domain. + */ + private String profileName; + + /** + * Creates an instance of AfdDomainProperties class. + */ + public AfdDomainProperties() { + } + + /** + * Get the domainValidationState property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. DCV stands for DomainControlValidation. + * + * @return the domainValidationState value. + */ + public DomainValidationState domainValidationState() { + return this.domainValidationState; + } + + /** + * Get the hostname property: The host name of the domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the AfdDomainProperties object itself. + */ + public AfdDomainProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @param extendedProperties the extendedProperties value to set. + * @return the AfdDomainProperties object itself. + */ + public AfdDomainProperties withExtendedProperties(Map extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the validationProperties property: Values the customer needs to validate domain ownership. + * + * @return the validationProperties value. + */ + public DomainValidationProperties validationProperties() { + return this.validationProperties; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the profileName property: The name of the profile which holds the domain. + * + * @return the profileName value. + */ + @Override + public String profileName() { + return this.profileName; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdDomainProperties withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + super.withTlsSettings(tlsSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdDomainProperties withAzureDnsZone(ResourceReference azureDnsZone) { + super.withAzureDnsZone(azureDnsZone); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdDomainProperties + withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId) { + super.withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (hostname() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property hostname in model AfdDomainProperties")); + } + if (validationProperties() != null) { + validationProperties().validate(); + } + if (tlsSettings() != null) { + tlsSettings().validate(); + } + if (azureDnsZone() != null) { + azureDnsZone().validate(); + } + if (preValidatedCustomDomainResourceId() != null) { + preValidatedCustomDomainResourceId().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AfdDomainProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("tlsSettings", tlsSettings()); + jsonWriter.writeJsonField("azureDnsZone", azureDnsZone()); + jsonWriter.writeJsonField("preValidatedCustomDomainResourceId", preValidatedCustomDomainResourceId()); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeMapField("extendedProperties", this.extendedProperties, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdDomainProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdDomainProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AfdDomainProperties. + */ + public static AfdDomainProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdDomainProperties deserializedAfdDomainProperties = new AfdDomainProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("profileName".equals(fieldName)) { + deserializedAfdDomainProperties.profileName = reader.getString(); + } else if ("tlsSettings".equals(fieldName)) { + deserializedAfdDomainProperties.withTlsSettings(AfdDomainHttpsParameters.fromJson(reader)); + } else if ("azureDnsZone".equals(fieldName)) { + deserializedAfdDomainProperties.withAzureDnsZone(ResourceReference.fromJson(reader)); + } else if ("preValidatedCustomDomainResourceId".equals(fieldName)) { + deserializedAfdDomainProperties + .withPreValidatedCustomDomainResourceId(ResourceReference.fromJson(reader)); + } else if ("hostName".equals(fieldName)) { + deserializedAfdDomainProperties.hostname = reader.getString(); + } else if ("domainValidationState".equals(fieldName)) { + deserializedAfdDomainProperties.domainValidationState + = DomainValidationState.fromString(reader.getString()); + } else if ("extendedProperties".equals(fieldName)) { + Map extendedProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedAfdDomainProperties.extendedProperties = extendedProperties; + } else if ("validationProperties".equals(fieldName)) { + deserializedAfdDomainProperties.validationProperties = DomainValidationProperties.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedAfdDomainProperties.provisioningState + = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedAfdDomainProperties.deploymentStatus = DeploymentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdDomainProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainUpdatePropertiesParameters.java new file mode 100644 index 000000000000..e6f1590d064d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainUpdatePropertiesParameters.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.io.IOException; + +/** + * The JSON object that contains the properties of the domain to create. + */ +@Fluent +public class AfdDomainUpdatePropertiesParameters implements JsonSerializable { + /* + * The name of the profile which holds the domain. + */ + private String profileName; + + /* + * The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor managed certificate or + * user's own certificate. If not specified, enabling ssl uses AzureFrontDoor managed certificate by default. + */ + private AfdDomainHttpsParameters tlsSettings; + + /* + * Resource reference to the Azure DNS zone + */ + private ResourceReference azureDnsZone; + + /* + * Resource reference to the Azure resource where custom domain ownership was prevalidated + */ + private ResourceReference preValidatedCustomDomainResourceId; + + /** + * Creates an instance of AfdDomainUpdatePropertiesParameters class. + */ + public AfdDomainUpdatePropertiesParameters() { + } + + /** + * Get the profileName property: The name of the profile which holds the domain. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Set the profileName property: The name of the profile which holds the domain. + * + * @param profileName the profileName value to set. + * @return the AfdDomainUpdatePropertiesParameters object itself. + */ + AfdDomainUpdatePropertiesParameters withProfileName(String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @return the tlsSettings value. + */ + public AfdDomainHttpsParameters tlsSettings() { + return this.tlsSettings; + } + + /** + * Set the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @param tlsSettings the tlsSettings value to set. + * @return the AfdDomainUpdatePropertiesParameters object itself. + */ + public AfdDomainUpdatePropertiesParameters withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + this.tlsSettings = tlsSettings; + return this; + } + + /** + * Get the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @return the azureDnsZone value. + */ + public ResourceReference azureDnsZone() { + return this.azureDnsZone; + } + + /** + * Set the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone the azureDnsZone value to set. + * @return the AfdDomainUpdatePropertiesParameters object itself. + */ + public AfdDomainUpdatePropertiesParameters withAzureDnsZone(ResourceReference azureDnsZone) { + this.azureDnsZone = azureDnsZone; + return this; + } + + /** + * Get the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @return the preValidatedCustomDomainResourceId value. + */ + public ResourceReference preValidatedCustomDomainResourceId() { + return this.preValidatedCustomDomainResourceId; + } + + /** + * Set the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId the preValidatedCustomDomainResourceId value to set. + * @return the AfdDomainUpdatePropertiesParameters object itself. + */ + public AfdDomainUpdatePropertiesParameters + withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId) { + this.preValidatedCustomDomainResourceId = preValidatedCustomDomainResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tlsSettings() != null) { + tlsSettings().validate(); + } + if (azureDnsZone() != null) { + azureDnsZone().validate(); + } + if (preValidatedCustomDomainResourceId() != null) { + preValidatedCustomDomainResourceId().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("tlsSettings", this.tlsSettings); + jsonWriter.writeJsonField("azureDnsZone", this.azureDnsZone); + jsonWriter.writeJsonField("preValidatedCustomDomainResourceId", this.preValidatedCustomDomainResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdDomainUpdatePropertiesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdDomainUpdatePropertiesParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdDomainUpdatePropertiesParameters. + */ + public static AfdDomainUpdatePropertiesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdDomainUpdatePropertiesParameters deserializedAfdDomainUpdatePropertiesParameters + = new AfdDomainUpdatePropertiesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("profileName".equals(fieldName)) { + deserializedAfdDomainUpdatePropertiesParameters.profileName = reader.getString(); + } else if ("tlsSettings".equals(fieldName)) { + deserializedAfdDomainUpdatePropertiesParameters.tlsSettings + = AfdDomainHttpsParameters.fromJson(reader); + } else if ("azureDnsZone".equals(fieldName)) { + deserializedAfdDomainUpdatePropertiesParameters.azureDnsZone = ResourceReference.fromJson(reader); + } else if ("preValidatedCustomDomainResourceId".equals(fieldName)) { + deserializedAfdDomainUpdatePropertiesParameters.preValidatedCustomDomainResourceId + = ResourceReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdDomainUpdatePropertiesParameters; + }); + } +} 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 000000000000..dbcb3cc965f2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointInner.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import java.io.IOException; +import java.util.Map; + +/** + * Azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration information such + * as origin, protocol, content caching and delivery behavior. The AzureFrontDoor endpoint uses the URL format + * <endpointname>.azureedge.net. + */ +@Fluent +public final class AfdEndpointInner extends Resource { + /* + * The JSON object that contains the properties required to create an endpoint. + */ + private AfdEndpointProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AfdEndpointInner class. + */ + public AfdEndpointInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties required to create an endpoint. + * + * @return the innerProperties value. + */ + private AfdEndpointProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdEndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdEndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Get the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() { + return this.innerProperties() == null ? null : this.innerProperties().autoGeneratedDomainNameLabelScope(); + } + + /** + * Set the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set. + * @return the AfdEndpointInner object itself. + */ + public AfdEndpointInner + withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdEndpointProperties(); + } + this.innerProperties().withAutoGeneratedDomainNameLabelScope(autoGeneratedDomainNameLabelScope); + return this; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the profileName property: The name of the profile which holds the endpoint. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the AfdEndpointInner object itself. + */ + public AfdEndpointInner withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdEndpointProperties(); + } + this.innerProperties().withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdEndpointInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdEndpointInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AfdEndpointInner. + */ + public static AfdEndpointInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdEndpointInner deserializedAfdEndpointInner = new AfdEndpointInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAfdEndpointInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAfdEndpointInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAfdEndpointInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAfdEndpointInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAfdEndpointInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAfdEndpointInner.innerProperties = AfdEndpointProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAfdEndpointInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdEndpointInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointProperties.java new file mode 100644 index 000000000000..6456dc1b778e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointProperties.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import java.io.IOException; + +/** + * The JSON object that contains the properties required to create an endpoint. + */ +@Fluent +public final class AfdEndpointProperties extends AfdEndpointPropertiesUpdateParameters { + /* + * The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net + */ + private String hostname; + + /* + * Indicates the endpoint name reuse scope. The default value is TenantReuse. + */ + private AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope; + + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /* + * The name of the profile which holds the endpoint. + */ + private String profileName; + + /** + * Creates an instance of AfdEndpointProperties class. + */ + public AfdEndpointProperties() { + } + + /** + * Get the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() { + return this.autoGeneratedDomainNameLabelScope; + } + + /** + * Set the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set. + * @return the AfdEndpointProperties object itself. + */ + public AfdEndpointProperties + withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) { + this.autoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; + return this; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the profileName property: The name of the profile which holds the endpoint. + * + * @return the profileName value. + */ + @Override + public String profileName() { + return this.profileName; + } + + /** + * {@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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("enabledState", enabledState() == null ? null : enabledState().toString()); + jsonWriter.writeStringField("autoGeneratedDomainNameLabelScope", + this.autoGeneratedDomainNameLabelScope == null ? null : this.autoGeneratedDomainNameLabelScope.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdEndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdEndpointProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdEndpointProperties. + */ + public static AfdEndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdEndpointProperties deserializedAfdEndpointProperties = new AfdEndpointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("profileName".equals(fieldName)) { + deserializedAfdEndpointProperties.profileName = reader.getString(); + } else if ("enabledState".equals(fieldName)) { + deserializedAfdEndpointProperties.withEnabledState(EnabledState.fromString(reader.getString())); + } else if ("hostName".equals(fieldName)) { + deserializedAfdEndpointProperties.hostname = reader.getString(); + } else if ("autoGeneratedDomainNameLabelScope".equals(fieldName)) { + deserializedAfdEndpointProperties.autoGeneratedDomainNameLabelScope + = AutoGeneratedDomainNameLabelScope.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedAfdEndpointProperties.provisioningState + = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedAfdEndpointProperties.deploymentStatus + = DeploymentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdEndpointProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointPropertiesUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointPropertiesUpdateParameters.java new file mode 100644 index 000000000000..b9955e78461f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointPropertiesUpdateParameters.java @@ -0,0 +1,123 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import java.io.IOException; + +/** + * The JSON object containing endpoint update parameters. + */ +@Fluent +public class AfdEndpointPropertiesUpdateParameters implements JsonSerializable { + /* + * The name of the profile which holds the endpoint. + */ + private String profileName; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled' + */ + private EnabledState enabledState; + + /** + * Creates an instance of AfdEndpointPropertiesUpdateParameters class. + */ + public AfdEndpointPropertiesUpdateParameters() { + } + + /** + * Get the profileName property: The name of the profile which holds the endpoint. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Set the profileName property: The name of the profile which holds the endpoint. + * + * @param profileName the profileName value to set. + * @return the AfdEndpointPropertiesUpdateParameters object itself. + */ + AfdEndpointPropertiesUpdateParameters withProfileName(String profileName) { + this.profileName = profileName; + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("enabledState", this.enabledState == null ? null : this.enabledState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdEndpointPropertiesUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdEndpointPropertiesUpdateParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdEndpointPropertiesUpdateParameters. + */ + public static AfdEndpointPropertiesUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdEndpointPropertiesUpdateParameters deserializedAfdEndpointPropertiesUpdateParameters + = new AfdEndpointPropertiesUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("profileName".equals(fieldName)) { + deserializedAfdEndpointPropertiesUpdateParameters.profileName = reader.getString(); + } else if ("enabledState".equals(fieldName)) { + deserializedAfdEndpointPropertiesUpdateParameters.enabledState + = EnabledState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdEndpointPropertiesUpdateParameters; + }); + } +} 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 000000000000..349d3aed9e54 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupInner.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.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 java.io.IOException; + +/** + * AFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be served from + * Azure Front Door. + */ +@Fluent +public final class AfdOriginGroupInner extends ProxyResource { + /* + * The JSON object that contains the properties of the origin group. + */ + private AfdOriginGroupProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AfdOriginGroupInner class. + */ + public AfdOriginGroupInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin group. + * + * @return the innerProperties value. + */ + private AfdOriginGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the profileName property: The name of the profile which holds the origin group. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + public LoadBalancingSettingsParameters loadBalancingSettings() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancingSettings(); + } + + /** + * Set the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupProperties(); + } + this.innerProperties().withLoadBalancingSettings(loadBalancingSettings); + return this; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupProperties(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupProperties(); + } + this.innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityState value. + */ + public EnabledState sessionAffinityState() { + return this.innerProperties() == null ? null : this.innerProperties().sessionAffinityState(); + } + + /** + * Set the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState the sessionAffinityState value to set. + * @return the AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withSessionAffinityState(EnabledState sessionAffinityState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupProperties(); + } + this.innerProperties().withSessionAffinityState(sessionAffinityState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginGroupInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AfdOriginGroupInner. + */ + public static AfdOriginGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginGroupInner deserializedAfdOriginGroupInner = new AfdOriginGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAfdOriginGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAfdOriginGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAfdOriginGroupInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAfdOriginGroupInner.innerProperties = AfdOriginGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAfdOriginGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginGroupInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupProperties.java new file mode 100644 index 000000000000..832af6973c55 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupProperties.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * The JSON object that contains the properties of the origin group. + */ +@Fluent +public final class AfdOriginGroupProperties extends AfdOriginGroupUpdatePropertiesParameters { + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /* + * The name of the profile which holds the origin group. + */ + private String profileName; + + /** + * Creates an instance of AfdOriginGroupProperties class. + */ + public AfdOriginGroupProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the profileName property: The name of the profile which holds the origin group. + * + * @return the profileName value. + */ + @Override + public String profileName() { + return this.profileName; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginGroupProperties withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings) { + super.withLoadBalancingSettings(loadBalancingSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginGroupProperties withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + super.withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginGroupProperties withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + super.withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginGroupProperties withSessionAffinityState(EnabledState sessionAffinityState) { + super.withSessionAffinityState(sessionAffinityState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (loadBalancingSettings() != null) { + loadBalancingSettings().validate(); + } + if (healthProbeSettings() != null) { + healthProbeSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("loadBalancingSettings", loadBalancingSettings()); + jsonWriter.writeJsonField("healthProbeSettings", healthProbeSettings()); + jsonWriter.writeNumberField("trafficRestorationTimeToHealedOrNewEndpointsInMinutes", + trafficRestorationTimeToHealedOrNewEndpointsInMinutes()); + jsonWriter.writeStringField("sessionAffinityState", + sessionAffinityState() == null ? null : sessionAffinityState().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginGroupProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdOriginGroupProperties. + */ + public static AfdOriginGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginGroupProperties deserializedAfdOriginGroupProperties = new AfdOriginGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("profileName".equals(fieldName)) { + deserializedAfdOriginGroupProperties.profileName = reader.getString(); + } else if ("loadBalancingSettings".equals(fieldName)) { + deserializedAfdOriginGroupProperties + .withLoadBalancingSettings(LoadBalancingSettingsParameters.fromJson(reader)); + } else if ("healthProbeSettings".equals(fieldName)) { + deserializedAfdOriginGroupProperties + .withHealthProbeSettings(HealthProbeParameters.fromJson(reader)); + } else if ("trafficRestorationTimeToHealedOrNewEndpointsInMinutes".equals(fieldName)) { + deserializedAfdOriginGroupProperties.withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + reader.getNullable(JsonReader::getInt)); + } else if ("sessionAffinityState".equals(fieldName)) { + deserializedAfdOriginGroupProperties + .withSessionAffinityState(EnabledState.fromString(reader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedAfdOriginGroupProperties.provisioningState + = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedAfdOriginGroupProperties.deploymentStatus + = DeploymentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginGroupProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupUpdatePropertiesParameters.java new file mode 100644 index 000000000000..aca3614f33b1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupUpdatePropertiesParameters.java @@ -0,0 +1,234 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * The JSON object that contains the properties of the origin group. + */ +@Fluent +public class AfdOriginGroupUpdatePropertiesParameters + implements JsonSerializable { + /* + * The name of the profile which holds the origin group. + */ + private String profileName; + + /* + * Load balancing settings for a backend pool + */ + private LoadBalancingSettingsParameters loadBalancingSettings; + + /* + * Health probe settings to the origin that is used to determine the health of the origin. + */ + 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. + */ + private Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + + /* + * Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled' + */ + private EnabledState sessionAffinityState; + + /** + * Creates an instance of AfdOriginGroupUpdatePropertiesParameters class. + */ + public AfdOriginGroupUpdatePropertiesParameters() { + } + + /** + * Get the profileName property: The name of the profile which holds the origin group. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Set the profileName property: The name of the profile which holds the origin group. + * + * @param profileName the profileName value to set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + AfdOriginGroupUpdatePropertiesParameters withProfileName(String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + public LoadBalancingSettingsParameters loadBalancingSettings() { + return this.loadBalancingSettings; + } + + /** + * Set the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + public AfdOriginGroupUpdatePropertiesParameters + withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings) { + this.loadBalancingSettings = loadBalancingSettings; + return this; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + public AfdOriginGroupUpdatePropertiesParameters withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + public AfdOriginGroupUpdatePropertiesParameters withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes + = trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + return this; + } + + /** + * Get the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityState value. + */ + public EnabledState sessionAffinityState() { + return this.sessionAffinityState; + } + + /** + * Set the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState the sessionAffinityState value to set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + public AfdOriginGroupUpdatePropertiesParameters withSessionAffinityState(EnabledState sessionAffinityState) { + this.sessionAffinityState = sessionAffinityState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancingSettings() != null) { + loadBalancingSettings().validate(); + } + if (healthProbeSettings() != null) { + healthProbeSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("loadBalancingSettings", this.loadBalancingSettings); + jsonWriter.writeJsonField("healthProbeSettings", this.healthProbeSettings); + jsonWriter.writeNumberField("trafficRestorationTimeToHealedOrNewEndpointsInMinutes", + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + jsonWriter.writeStringField("sessionAffinityState", + this.sessionAffinityState == null ? null : this.sessionAffinityState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginGroupUpdatePropertiesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginGroupUpdatePropertiesParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdOriginGroupUpdatePropertiesParameters. + */ + public static AfdOriginGroupUpdatePropertiesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginGroupUpdatePropertiesParameters deserializedAfdOriginGroupUpdatePropertiesParameters + = new AfdOriginGroupUpdatePropertiesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("profileName".equals(fieldName)) { + deserializedAfdOriginGroupUpdatePropertiesParameters.profileName = reader.getString(); + } else if ("loadBalancingSettings".equals(fieldName)) { + deserializedAfdOriginGroupUpdatePropertiesParameters.loadBalancingSettings + = LoadBalancingSettingsParameters.fromJson(reader); + } else if ("healthProbeSettings".equals(fieldName)) { + deserializedAfdOriginGroupUpdatePropertiesParameters.healthProbeSettings + = HealthProbeParameters.fromJson(reader); + } else if ("trafficRestorationTimeToHealedOrNewEndpointsInMinutes".equals(fieldName)) { + deserializedAfdOriginGroupUpdatePropertiesParameters.trafficRestorationTimeToHealedOrNewEndpointsInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("sessionAffinityState".equals(fieldName)) { + deserializedAfdOriginGroupUpdatePropertiesParameters.sessionAffinityState + = EnabledState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginGroupUpdatePropertiesParameters; + }); + } +} 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 000000000000..cd3ff833978a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginInner.java @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SharedPrivateLinkResourceProperties; +import java.io.IOException; + +/** + * Azure Front Door origin is the source of the content being delivered via Azure Front Door. When the edge nodes + * represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the + * configured origins. + */ +@Fluent +public final class AfdOriginInner extends ProxyResource { + /* + * The JSON object that contains the properties of the origin. + */ + private AfdOriginProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AfdOriginInner class. + */ + public AfdOriginInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin. + * + * @return the innerProperties value. + */ + private AfdOriginProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the originGroupName property: The name of the origin group which contains this origin. + * + * @return the originGroupName value. + */ + public String originGroupName() { + return this.innerProperties() == null ? null : this.innerProperties().originGroupName(); + } + + /** + * Get the azureOrigin property: Resource reference to the Azure origin resource. + * + * @return the azureOrigin value. + */ + public ResourceReference azureOrigin() { + return this.innerProperties() == null ? null : this.innerProperties().azureOrigin(); + } + + /** + * Set the azureOrigin property: Resource reference to the Azure origin resource. + * + * @param azureOrigin the azureOrigin value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withAzureOrigin(ResourceReference azureOrigin) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withAzureOrigin(azureOrigin); + return this; + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @return the sharedPrivateLinkResource value. + */ + public SharedPrivateLinkResourceProperties sharedPrivateLinkResource() { + return this.innerProperties() == null ? null : this.innerProperties().sharedPrivateLinkResource(); + } + + /** + * Set the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @param sharedPrivateLinkResource the sharedPrivateLinkResource value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } + + /** + * Get the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @param enabledState the enabledState value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withEnabledState(enabledState); + return this; + } + + /** + * Get the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @return the enforceCertificateNameCheck value. + */ + public Boolean enforceCertificateNameCheck() { + return this.innerProperties() == null ? null : this.innerProperties().enforceCertificateNameCheck(); + } + + /** + * Set the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @param enforceCertificateNameCheck the enforceCertificateNameCheck value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withEnforceCertificateNameCheck(enforceCertificateNameCheck); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AfdOriginInner. + */ + public static AfdOriginInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginInner deserializedAfdOriginInner = new AfdOriginInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAfdOriginInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAfdOriginInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAfdOriginInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAfdOriginInner.innerProperties = AfdOriginProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAfdOriginInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginProperties.java new file mode 100644 index 000000000000..0e0369f97f29 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginProperties.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SharedPrivateLinkResourceProperties; +import java.io.IOException; + +/** + * The JSON object that contains the properties of the origin. + */ +@Fluent +public final class AfdOriginProperties extends AfdOriginUpdatePropertiesParameters { + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /* + * The name of the origin group which contains this origin. + */ + private String originGroupName; + + /** + * Creates an instance of AfdOriginProperties class. + */ + public AfdOriginProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the originGroupName property: The name of the origin group which contains this origin. + * + * @return the originGroupName value. + */ + @Override + public String originGroupName() { + return this.originGroupName; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties withAzureOrigin(ResourceReference azureOrigin) { + super.withAzureOrigin(azureOrigin); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties withHostname(String hostname) { + super.withHostname(hostname); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties withHttpPort(Integer httpPort) { + super.withHttpPort(httpPort); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties withHttpsPort(Integer httpsPort) { + super.withHttpsPort(httpsPort); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties withOriginHostHeader(String originHostHeader) { + super.withOriginHostHeader(originHostHeader); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties withWeight(Integer weight) { + super.withWeight(weight); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties + withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + super.withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties withEnabledState(EnabledState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AfdOriginProperties withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + super.withEnforceCertificateNameCheck(enforceCertificateNameCheck); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (azureOrigin() != null) { + azureOrigin().validate(); + } + if (sharedPrivateLinkResource() != null) { + sharedPrivateLinkResource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("azureOrigin", azureOrigin()); + jsonWriter.writeStringField("hostName", hostname()); + jsonWriter.writeNumberField("httpPort", httpPort()); + jsonWriter.writeNumberField("httpsPort", httpsPort()); + jsonWriter.writeStringField("originHostHeader", originHostHeader()); + jsonWriter.writeNumberField("priority", priority()); + jsonWriter.writeNumberField("weight", weight()); + jsonWriter.writeJsonField("sharedPrivateLinkResource", sharedPrivateLinkResource()); + jsonWriter.writeStringField("enabledState", enabledState() == null ? null : enabledState().toString()); + jsonWriter.writeBooleanField("enforceCertificateNameCheck", enforceCertificateNameCheck()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdOriginProperties. + */ + public static AfdOriginProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginProperties deserializedAfdOriginProperties = new AfdOriginProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("originGroupName".equals(fieldName)) { + deserializedAfdOriginProperties.originGroupName = reader.getString(); + } else if ("azureOrigin".equals(fieldName)) { + deserializedAfdOriginProperties.withAzureOrigin(ResourceReference.fromJson(reader)); + } else if ("hostName".equals(fieldName)) { + deserializedAfdOriginProperties.withHostname(reader.getString()); + } else if ("httpPort".equals(fieldName)) { + deserializedAfdOriginProperties.withHttpPort(reader.getNullable(JsonReader::getInt)); + } else if ("httpsPort".equals(fieldName)) { + deserializedAfdOriginProperties.withHttpsPort(reader.getNullable(JsonReader::getInt)); + } else if ("originHostHeader".equals(fieldName)) { + deserializedAfdOriginProperties.withOriginHostHeader(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedAfdOriginProperties.withPriority(reader.getNullable(JsonReader::getInt)); + } else if ("weight".equals(fieldName)) { + deserializedAfdOriginProperties.withWeight(reader.getNullable(JsonReader::getInt)); + } else if ("sharedPrivateLinkResource".equals(fieldName)) { + deserializedAfdOriginProperties + .withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties.fromJson(reader)); + } else if ("enabledState".equals(fieldName)) { + deserializedAfdOriginProperties.withEnabledState(EnabledState.fromString(reader.getString())); + } else if ("enforceCertificateNameCheck".equals(fieldName)) { + deserializedAfdOriginProperties + .withEnforceCertificateNameCheck(reader.getNullable(JsonReader::getBoolean)); + } else if ("provisioningState".equals(fieldName)) { + deserializedAfdOriginProperties.provisioningState + = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedAfdOriginProperties.deploymentStatus = DeploymentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginUpdatePropertiesParameters.java new file mode 100644 index 000000000000..29683a7da13e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginUpdatePropertiesParameters.java @@ -0,0 +1,407 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SharedPrivateLinkResourceProperties; +import java.io.IOException; + +/** + * The JSON object that contains the properties of the origin. + */ +@Fluent +public class AfdOriginUpdatePropertiesParameters implements JsonSerializable { + /* + * The name of the origin group which contains this origin. + */ + private String originGroupName; + + /* + * Resource reference to the Azure origin resource. + */ + 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. + */ + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + private Integer httpsPort; + + /* + * The host header value sent to the origin with each request. If you leave this blank, the request hostname + * determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and Cloud Services require this + * host header value to match the origin hostname by default. This overrides the host header defined at Endpoint + */ + 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 + */ + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 + */ + private Integer weight; + + /* + * The properties of the private link resource for private origin. + */ + private SharedPrivateLinkResourceProperties sharedPrivateLinkResource; + + /* + * Whether to enable health probes to be made against backends defined under backendPools. Health probes can only be + * disabled if there is a single enabled backend in single enabled backend pool. + */ + private EnabledState enabledState; + + /* + * Whether to enable certificate name check at origin level + */ + private Boolean enforceCertificateNameCheck; + + /** + * Creates an instance of AfdOriginUpdatePropertiesParameters class. + */ + public AfdOriginUpdatePropertiesParameters() { + } + + /** + * Get the originGroupName property: The name of the origin group which contains this origin. + * + * @return the originGroupName value. + */ + public String originGroupName() { + return this.originGroupName; + } + + /** + * Set the originGroupName property: The name of the origin group which contains this origin. + * + * @param originGroupName the originGroupName value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + AfdOriginUpdatePropertiesParameters withOriginGroupName(String originGroupName) { + this.originGroupName = originGroupName; + return this; + } + + /** + * Get the azureOrigin property: Resource reference to the Azure origin resource. + * + * @return the azureOrigin value. + */ + public ResourceReference azureOrigin() { + return this.azureOrigin; + } + + /** + * Set the azureOrigin property: Resource reference to the Azure origin resource. + * + * @param azureOrigin the azureOrigin value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withAzureOrigin(ResourceReference azureOrigin) { + this.azureOrigin = azureOrigin; + return this; + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @return the sharedPrivateLinkResource value. + */ + public SharedPrivateLinkResourceProperties sharedPrivateLinkResource() { + return this.sharedPrivateLinkResource; + } + + /** + * Set the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @param sharedPrivateLinkResource the sharedPrivateLinkResource value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters + withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + this.sharedPrivateLinkResource = sharedPrivateLinkResource; + return this; + } + + /** + * Get the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @param enabledState the enabledState value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withEnabledState(EnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @return the enforceCertificateNameCheck value. + */ + public Boolean enforceCertificateNameCheck() { + return this.enforceCertificateNameCheck; + } + + /** + * Set the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @param enforceCertificateNameCheck the enforceCertificateNameCheck value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + this.enforceCertificateNameCheck = enforceCertificateNameCheck; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureOrigin() != null) { + azureOrigin().validate(); + } + if (sharedPrivateLinkResource() != null) { + sharedPrivateLinkResource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("azureOrigin", this.azureOrigin); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeNumberField("httpPort", this.httpPort); + jsonWriter.writeNumberField("httpsPort", this.httpsPort); + jsonWriter.writeStringField("originHostHeader", this.originHostHeader); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeNumberField("weight", this.weight); + jsonWriter.writeJsonField("sharedPrivateLinkResource", this.sharedPrivateLinkResource); + jsonWriter.writeStringField("enabledState", this.enabledState == null ? null : this.enabledState.toString()); + jsonWriter.writeBooleanField("enforceCertificateNameCheck", this.enforceCertificateNameCheck); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginUpdatePropertiesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginUpdatePropertiesParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdOriginUpdatePropertiesParameters. + */ + public static AfdOriginUpdatePropertiesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginUpdatePropertiesParameters deserializedAfdOriginUpdatePropertiesParameters + = new AfdOriginUpdatePropertiesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("originGroupName".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.originGroupName = reader.getString(); + } else if ("azureOrigin".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.azureOrigin = ResourceReference.fromJson(reader); + } else if ("hostName".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.hostname = reader.getString(); + } else if ("httpPort".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.httpPort = reader.getNullable(JsonReader::getInt); + } else if ("httpsPort".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.httpsPort = reader.getNullable(JsonReader::getInt); + } else if ("originHostHeader".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.originHostHeader = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.priority = reader.getNullable(JsonReader::getInt); + } else if ("weight".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.weight = reader.getNullable(JsonReader::getInt); + } else if ("sharedPrivateLinkResource".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.sharedPrivateLinkResource + = SharedPrivateLinkResourceProperties.fromJson(reader); + } else if ("enabledState".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.enabledState + = EnabledState.fromString(reader.getString()); + } else if ("enforceCertificateNameCheck".equals(fieldName)) { + deserializedAfdOriginUpdatePropertiesParameters.enforceCertificateNameCheck + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginUpdatePropertiesParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateProperties.java new file mode 100644 index 000000000000..ca5c44946b1b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateDefaultSku; +import com.azure.resourcemanager.cdn.generated.models.MigrationErrorType; +import java.io.IOException; +import java.util.List; + +/** + * The CanMigrateProperties model. + */ +@Fluent +public final class CanMigrateProperties implements JsonSerializable { + /* + * Flag that says if the profile can be migrated + */ + private Boolean canMigrate; + + /* + * Recommended sku for the migration + */ + private CanMigrateDefaultSku defaultSku; + + /* + * The errors property. + */ + private List errors; + + /** + * Creates an instance of CanMigrateProperties class. + */ + public CanMigrateProperties() { + } + + /** + * Get the canMigrate property: Flag that says if the profile can be migrated. + * + * @return the canMigrate value. + */ + public Boolean canMigrate() { + return this.canMigrate; + } + + /** + * Get the defaultSku property: Recommended sku for the migration. + * + * @return the defaultSku value. + */ + public CanMigrateDefaultSku defaultSku() { + return this.defaultSku; + } + + /** + * Get the errors property: The errors property. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The errors property. + * + * @param errors the errors value to set. + * @return the CanMigrateProperties object itself. + */ + public CanMigrateProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CanMigrateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CanMigrateProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CanMigrateProperties. + */ + public static CanMigrateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CanMigrateProperties deserializedCanMigrateProperties = new CanMigrateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("canMigrate".equals(fieldName)) { + deserializedCanMigrateProperties.canMigrate = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultSku".equals(fieldName)) { + deserializedCanMigrateProperties.defaultSku = CanMigrateDefaultSku.fromString(reader.getString()); + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> MigrationErrorType.fromJson(reader1)); + deserializedCanMigrateProperties.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedCanMigrateProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateResultInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateResultInner.java new file mode 100644 index 000000000000..e2b5ee4123d5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateDefaultSku; +import com.azure.resourcemanager.cdn.generated.models.MigrationErrorType; +import java.io.IOException; +import java.util.List; + +/** + * Result for canMigrate operation. + */ +@Fluent +public final class CanMigrateResultInner implements JsonSerializable { + /* + * Resource ID. + */ + private String id; + + /* + * Resource type. + */ + private String type; + + /* + * The properties property. + */ + private CanMigrateProperties innerProperties; + + /** + * Creates an instance of CanMigrateResultInner class. + */ + public CanMigrateResultInner() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private CanMigrateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the canMigrate property: Flag that says if the profile can be migrated. + * + * @return the canMigrate value. + */ + public Boolean canMigrate() { + return this.innerProperties() == null ? null : this.innerProperties().canMigrate(); + } + + /** + * Get the defaultSku property: Recommended sku for the migration. + * + * @return the defaultSku value. + */ + public CanMigrateDefaultSku defaultSku() { + return this.innerProperties() == null ? null : this.innerProperties().defaultSku(); + } + + /** + * Get the errors property: The errors property. + * + * @return the errors value. + */ + public List errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Set the errors property: The errors property. + * + * @param errors the errors value to set. + * @return the CanMigrateResultInner object itself. + */ + public CanMigrateResultInner withErrors(List errors) { + if (this.innerProperties() == null) { + this.innerProperties = new CanMigrateProperties(); + } + this.innerProperties().withErrors(errors); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CanMigrateResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CanMigrateResultInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CanMigrateResultInner. + */ + public static CanMigrateResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CanMigrateResultInner deserializedCanMigrateResultInner = new CanMigrateResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCanMigrateResultInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCanMigrateResultInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCanMigrateResultInner.innerProperties = CanMigrateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCanMigrateResultInner; + }); + } +} 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 000000000000..3ae40f12ee5f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyInner.java @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Defines web application firewall policy for Azure CDN. + */ +@Fluent +public final class CdnWebApplicationFirewallPolicyInner extends Resource { + /* + * Properties of the web application firewall policy. + */ + private CdnWebApplicationFirewallPolicyProperties innerProperties; + + /* + * Gets a unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. + */ + private Sku sku; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CdnWebApplicationFirewallPolicyInner class. + */ + public CdnWebApplicationFirewallPolicyInner() { + } + + /** + * Get the innerProperties property: Properties of the web application firewall policy. + * + * @return the innerProperties value. + */ + private CdnWebApplicationFirewallPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @param sku the sku value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CdnWebApplicationFirewallPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CdnWebApplicationFirewallPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the policySettings property: Describes policySettings for policy. + * + * @return the policySettings value. + */ + public PolicySettings policySettings() { + return this.innerProperties() == null ? null : this.innerProperties().policySettings(); + } + + /** + * Set the policySettings property: Describes policySettings for policy. + * + * @param policySettings the policySettings value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withPolicySettings(PolicySettings policySettings) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withPolicySettings(policySettings); + return this; + } + + /** + * Get the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @return the rateLimitRules value. + */ + public RateLimitRuleList rateLimitRules() { + return this.innerProperties() == null ? null : this.innerProperties().rateLimitRules(); + } + + /** + * Set the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @param rateLimitRules the rateLimitRules value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withRateLimitRules(RateLimitRuleList rateLimitRules) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withRateLimitRules(rateLimitRules); + return this; + } + + /** + * Get the customRules property: Describes custom rules inside the policy. + * + * @return the customRules value. + */ + public CustomRuleList customRules() { + return this.innerProperties() == null ? null : this.innerProperties().customRules(); + } + + /** + * Set the customRules property: Describes custom rules inside the policy. + * + * @param customRules the customRules value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withCustomRules(CustomRuleList customRules) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withCustomRules(customRules); + return this; + } + + /** + * Get the managedRules property: Describes managed rules inside the policy. + * + * @return the managedRules value. + */ + public ManagedRuleSetList managedRules() { + return this.innerProperties() == null ? null : this.innerProperties().managedRules(); + } + + /** + * Set the managedRules property: Describes managed rules inside the policy. + * + * @param managedRules the managedRules value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withManagedRules(ManagedRuleSetList managedRules) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withManagedRules(managedRules); + return this; + } + + /** + * Get the endpointLinks property: Describes Azure CDN endpoints associated with this Web Application Firewall + * policy. + * + * @return the endpointLinks value. + */ + public List endpointLinks() { + return this.innerProperties() == null ? null : this.innerProperties().endpointLinks(); + } + + /** + * Get the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); + } + + /** + * Set the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @param extendedProperties the extendedProperties value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withExtendedProperties(Map extendedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withExtendedProperties(extendedProperties); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the WebApplicationFirewallPolicy. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + public PolicyResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sku in model CdnWebApplicationFirewallPolicyInner")); + } else { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CdnWebApplicationFirewallPolicyInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CdnWebApplicationFirewallPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CdnWebApplicationFirewallPolicyInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CdnWebApplicationFirewallPolicyInner. + */ + public static CdnWebApplicationFirewallPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CdnWebApplicationFirewallPolicyInner deserializedCdnWebApplicationFirewallPolicyInner + = new CdnWebApplicationFirewallPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCdnWebApplicationFirewallPolicyInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyInner.sku = Sku.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyInner.innerProperties + = CdnWebApplicationFirewallPolicyProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCdnWebApplicationFirewallPolicyInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyProperties.java new file mode 100644 index 000000000000..215978d93ad7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Defines CDN web application firewall policy properties. + */ +@Fluent +public final class CdnWebApplicationFirewallPolicyProperties + implements JsonSerializable { + /* + * Describes policySettings for policy + */ + private PolicySettings policySettings; + + /* + * Describes rate limit rules inside the policy. + */ + private RateLimitRuleList rateLimitRules; + + /* + * Describes custom rules inside the policy. + */ + private CustomRuleList customRules; + + /* + * Describes managed rules inside the policy. + */ + private ManagedRuleSetList managedRules; + + /* + * Describes Azure CDN endpoints associated with this Web Application Firewall policy. + */ + private List endpointLinks; + + /* + * Key-Value pair representing additional properties for Web Application Firewall policy. + */ + private Map extendedProperties; + + /* + * Provisioning state of the WebApplicationFirewallPolicy. + */ + private ProvisioningState provisioningState; + + /* + * Resource status of the policy. + */ + private PolicyResourceState resourceState; + + /** + * Creates an instance of CdnWebApplicationFirewallPolicyProperties class. + */ + public CdnWebApplicationFirewallPolicyProperties() { + } + + /** + * Get the policySettings property: Describes policySettings for policy. + * + * @return the policySettings value. + */ + public PolicySettings policySettings() { + return this.policySettings; + } + + /** + * Set the policySettings property: Describes policySettings for policy. + * + * @param policySettings the policySettings value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withPolicySettings(PolicySettings policySettings) { + this.policySettings = policySettings; + return this; + } + + /** + * Get the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @return the rateLimitRules value. + */ + public RateLimitRuleList rateLimitRules() { + return this.rateLimitRules; + } + + /** + * Set the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @param rateLimitRules the rateLimitRules value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withRateLimitRules(RateLimitRuleList rateLimitRules) { + this.rateLimitRules = rateLimitRules; + return this; + } + + /** + * Get the customRules property: Describes custom rules inside the policy. + * + * @return the customRules value. + */ + public CustomRuleList customRules() { + return this.customRules; + } + + /** + * Set the customRules property: Describes custom rules inside the policy. + * + * @param customRules the customRules value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withCustomRules(CustomRuleList customRules) { + this.customRules = customRules; + return this; + } + + /** + * Get the managedRules property: Describes managed rules inside the policy. + * + * @return the managedRules value. + */ + public ManagedRuleSetList managedRules() { + return this.managedRules; + } + + /** + * Set the managedRules property: Describes managed rules inside the policy. + * + * @param managedRules the managedRules value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withManagedRules(ManagedRuleSetList managedRules) { + this.managedRules = managedRules; + return this; + } + + /** + * Get the endpointLinks property: Describes Azure CDN endpoints associated with this Web Application Firewall + * policy. + * + * @return the endpointLinks value. + */ + public List endpointLinks() { + return this.endpointLinks; + } + + /** + * Get the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @param extendedProperties the extendedProperties value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withExtendedProperties(Map extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the WebApplicationFirewallPolicy. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + public PolicyResourceState resourceState() { + return this.resourceState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policySettings() != null) { + policySettings().validate(); + } + if (rateLimitRules() != null) { + rateLimitRules().validate(); + } + if (customRules() != null) { + customRules().validate(); + } + if (managedRules() != null) { + managedRules().validate(); + } + if (endpointLinks() != null) { + endpointLinks().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("policySettings", this.policySettings); + jsonWriter.writeJsonField("rateLimitRules", this.rateLimitRules); + jsonWriter.writeJsonField("customRules", this.customRules); + jsonWriter.writeJsonField("managedRules", this.managedRules); + jsonWriter.writeMapField("extendedProperties", this.extendedProperties, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CdnWebApplicationFirewallPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CdnWebApplicationFirewallPolicyProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CdnWebApplicationFirewallPolicyProperties. + */ + public static CdnWebApplicationFirewallPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CdnWebApplicationFirewallPolicyProperties deserializedCdnWebApplicationFirewallPolicyProperties + = new CdnWebApplicationFirewallPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policySettings".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyProperties.policySettings + = PolicySettings.fromJson(reader); + } else if ("rateLimitRules".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyProperties.rateLimitRules + = RateLimitRuleList.fromJson(reader); + } else if ("customRules".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyProperties.customRules = CustomRuleList.fromJson(reader); + } else if ("managedRules".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyProperties.managedRules + = ManagedRuleSetList.fromJson(reader); + } else if ("endpointLinks".equals(fieldName)) { + List endpointLinks = reader.readArray(reader1 -> CdnEndpoint.fromJson(reader1)); + deserializedCdnWebApplicationFirewallPolicyProperties.endpointLinks = endpointLinks; + } else if ("extendedProperties".equals(fieldName)) { + Map extendedProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedCdnWebApplicationFirewallPolicyProperties.extendedProperties = extendedProperties; + } else if ("provisioningState".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceState".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyProperties.resourceState + = PolicyResourceState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCdnWebApplicationFirewallPolicyProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckEndpointNameAvailabilityOutputInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckEndpointNameAvailabilityOutputInner.java new file mode 100644 index 000000000000..8c3e69740ea7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckEndpointNameAvailabilityOutputInner.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output of check name availability API. + */ +@Immutable +public final class CheckEndpointNameAvailabilityOutputInner + implements JsonSerializable { + /* + * Indicates whether the name is available. + */ + private Boolean nameAvailable; + + /* + * Returns the available hostname generated based on the AutoGeneratedDomainNameLabelScope when the name is + * available, otherwise it returns empty string + */ + private String availableHostname; + + /* + * The reason why the name is not available. + */ + private String reason; + + /* + * The detailed error message describing why the name is not available. + */ + private String message; + + /** + * Creates an instance of CheckEndpointNameAvailabilityOutputInner class. + */ + public CheckEndpointNameAvailabilityOutputInner() { + } + + /** + * Get the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the availableHostname property: Returns the available hostname generated based on the + * AutoGeneratedDomainNameLabelScope when the name is available, otherwise it returns empty string. + * + * @return the availableHostname value. + */ + public String availableHostname() { + return this.availableHostname; + } + + /** + * Get the reason property: The reason why the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: The detailed error message describing why the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckEndpointNameAvailabilityOutputInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckEndpointNameAvailabilityOutputInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckEndpointNameAvailabilityOutputInner. + */ + public static CheckEndpointNameAvailabilityOutputInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckEndpointNameAvailabilityOutputInner deserializedCheckEndpointNameAvailabilityOutputInner + = new CheckEndpointNameAvailabilityOutputInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckEndpointNameAvailabilityOutputInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("availableHostname".equals(fieldName)) { + deserializedCheckEndpointNameAvailabilityOutputInner.availableHostname = reader.getString(); + } else if ("reason".equals(fieldName)) { + deserializedCheckEndpointNameAvailabilityOutputInner.reason = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedCheckEndpointNameAvailabilityOutputInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckEndpointNameAvailabilityOutputInner; + }); + } +} 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 000000000000..14f5b3db1631 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckNameAvailabilityOutputInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output of check name availability API. + */ +@Immutable +public final class CheckNameAvailabilityOutputInner implements JsonSerializable { + /* + * Indicates whether the name is available. + */ + private Boolean nameAvailable; + + /* + * The reason why the name is not available. + */ + private String reason; + + /* + * The detailed error message describing why the name is not available. + */ + private String message; + + /** + * Creates an instance of CheckNameAvailabilityOutputInner class. + */ + public CheckNameAvailabilityOutputInner() { + } + + /** + * Get the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: The reason why the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: The detailed error message describing why the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityOutputInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityOutputInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityOutputInner. + */ + public static CheckNameAvailabilityOutputInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityOutputInner deserializedCheckNameAvailabilityOutputInner + = new CheckNameAvailabilityOutputInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityOutputInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityOutputInner.reason = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityOutputInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityOutputInner; + }); + } +} 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 000000000000..deb6b4fc17a7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ContinentsResponseInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseContinentsItem; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseCountryOrRegionsItem; +import java.io.IOException; +import java.util.List; + +/** + * Continents Response. + */ +@Fluent +public final class ContinentsResponseInner implements JsonSerializable { + /* + * The continents property. + */ + private List continents; + + /* + * The countryOrRegions property. + */ + private List countryOrRegions; + + /** + * Creates an instance of ContinentsResponseInner class. + */ + public ContinentsResponseInner() { + } + + /** + * Get the continents property: The continents property. + * + * @return the continents value. + */ + public List continents() { + return this.continents; + } + + /** + * Set the continents property: The continents property. + * + * @param continents the continents value to set. + * @return the ContinentsResponseInner object itself. + */ + public ContinentsResponseInner withContinents(List continents) { + this.continents = continents; + return this; + } + + /** + * Get the countryOrRegions property: The countryOrRegions property. + * + * @return the countryOrRegions value. + */ + public List countryOrRegions() { + return this.countryOrRegions; + } + + /** + * Set the countryOrRegions property: The countryOrRegions property. + * + * @param countryOrRegions the countryOrRegions value to set. + * @return the ContinentsResponseInner object itself. + */ + public ContinentsResponseInner withCountryOrRegions(List countryOrRegions) { + this.countryOrRegions = countryOrRegions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (continents() != null) { + continents().forEach(e -> e.validate()); + } + if (countryOrRegions() != null) { + countryOrRegions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("continents", this.continents, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("countryOrRegions", this.countryOrRegions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContinentsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContinentsResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContinentsResponseInner. + */ + public static ContinentsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContinentsResponseInner deserializedContinentsResponseInner = new ContinentsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("continents".equals(fieldName)) { + List continents + = reader.readArray(reader1 -> ContinentsResponseContinentsItem.fromJson(reader1)); + deserializedContinentsResponseInner.continents = continents; + } else if ("countryOrRegions".equals(fieldName)) { + List countryOrRegions + = reader.readArray(reader1 -> ContinentsResponseCountryOrRegionsItem.fromJson(reader1)); + deserializedContinentsResponseInner.countryOrRegions = countryOrRegions; + } else { + reader.skipChildren(); + } + } + + return deserializedContinentsResponseInner; + }); + } +} 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 000000000000..e8bb479ce163 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainInner.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainResourceState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningSubstate; +import java.io.IOException; + +/** + * Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. + * www.contoso.com. + */ +@Fluent +public final class CustomDomainInner extends ProxyResource { + /* + * The JSON object that contains the properties of the custom domain to create. + */ + private CustomDomainProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CustomDomainInner class. + */ + public CustomDomainInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the custom domain to create. + * + * @return the innerProperties value. + */ + private CustomDomainProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the CustomDomainInner object itself. + */ + public CustomDomainInner withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomDomainProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the resourceState property: Resource status of the custom domain. + * + * @return the resourceState value. + */ + public CustomDomainResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the customHttpsProvisioningState property: Provisioning status of the custom domain. + * + * @return the customHttpsProvisioningState value. + */ + public CustomHttpsProvisioningState customHttpsProvisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().customHttpsProvisioningState(); + } + + /** + * Get the customHttpsProvisioningSubstate property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. + * + * @return the customHttpsProvisioningSubstate value. + */ + public CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate() { + return this.innerProperties() == null ? null : this.innerProperties().customHttpsProvisioningSubstate(); + } + + /** + * Get the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @return the customHttpsParameters value. + */ + public CustomDomainHttpsParameters customHttpsParameters() { + return this.innerProperties() == null ? null : this.innerProperties().customHttpsParameters(); + } + + /** + * Set the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @param customHttpsParameters the customHttpsParameters value to set. + * @return the CustomDomainInner object itself. + */ + public CustomDomainInner withCustomHttpsParameters(CustomDomainHttpsParameters customHttpsParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomDomainProperties(); + } + this.innerProperties().withCustomHttpsParameters(customHttpsParameters); + return this; + } + + /** + * Get the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + public String validationData() { + return this.innerProperties() == null ? null : this.innerProperties().validationData(); + } + + /** + * Set the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @param validationData the validationData value to set. + * @return the CustomDomainInner object itself. + */ + public CustomDomainInner withValidationData(String validationData) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomDomainProperties(); + } + this.innerProperties().withValidationData(validationData); + return this; + } + + /** + * Get the provisioningState property: Provisioning status of Custom Https of the custom domain. + * + * @return the provisioningState value. + */ + public CustomHttpsProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomainInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomainInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomDomainInner. + */ + public static CustomDomainInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomainInner deserializedCustomDomainInner = new CustomDomainInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCustomDomainInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCustomDomainInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCustomDomainInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCustomDomainInner.innerProperties = CustomDomainProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCustomDomainInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomainInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainProperties.java new file mode 100644 index 000000000000..b2f018a768b6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainProperties.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainResourceState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningSubstate; +import java.io.IOException; + +/** + * The JSON object that contains the properties of the custom domain to create. + */ +@Fluent +public final class CustomDomainProperties implements JsonSerializable { + /* + * The host name of the custom domain. Must be a domain name. + */ + private String hostname; + + /* + * Resource status of the custom domain. + */ + private CustomDomainResourceState resourceState; + + /* + * Provisioning status of the custom domain. + */ + private CustomHttpsProvisioningState customHttpsProvisioningState; + + /* + * Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. + */ + private CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate; + + /* + * Certificate parameters for securing custom HTTPS + */ + private CustomDomainHttpsParameters customHttpsParameters; + + /* + * Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. + * E.g. ICP license number of a custom domain is required to deliver content in China. + */ + private String validationData; + + /* + * Provisioning status of Custom Https of the custom domain. + */ + private CustomHttpsProvisioningState provisioningState; + + /** + * Creates an instance of CustomDomainProperties class. + */ + public CustomDomainProperties() { + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the resourceState property: Resource status of the custom domain. + * + * @return the resourceState value. + */ + public CustomDomainResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the customHttpsProvisioningState property: Provisioning status of the custom domain. + * + * @return the customHttpsProvisioningState value. + */ + public CustomHttpsProvisioningState customHttpsProvisioningState() { + return this.customHttpsProvisioningState; + } + + /** + * Get the customHttpsProvisioningSubstate property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. + * + * @return the customHttpsProvisioningSubstate value. + */ + public CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate() { + return this.customHttpsProvisioningSubstate; + } + + /** + * Get the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @return the customHttpsParameters value. + */ + public CustomDomainHttpsParameters customHttpsParameters() { + return this.customHttpsParameters; + } + + /** + * Set the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @param customHttpsParameters the customHttpsParameters value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withCustomHttpsParameters(CustomDomainHttpsParameters customHttpsParameters) { + this.customHttpsParameters = customHttpsParameters; + return this; + } + + /** + * Get the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + public String validationData() { + return this.validationData; + } + + /** + * Set the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @param validationData the validationData value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withValidationData(String validationData) { + this.validationData = validationData; + return this; + } + + /** + * Get the provisioningState property: Provisioning status of Custom Https of the custom domain. + * + * @return the provisioningState value. + */ + public CustomHttpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property hostname in model CustomDomainProperties")); + } + if (customHttpsParameters() != null) { + customHttpsParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeJsonField("customHttpsParameters", this.customHttpsParameters); + jsonWriter.writeStringField("validationData", this.validationData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomainProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomainProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomDomainProperties. + */ + public static CustomDomainProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomainProperties deserializedCustomDomainProperties = new CustomDomainProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedCustomDomainProperties.hostname = reader.getString(); + } else if ("resourceState".equals(fieldName)) { + deserializedCustomDomainProperties.resourceState + = CustomDomainResourceState.fromString(reader.getString()); + } else if ("customHttpsProvisioningState".equals(fieldName)) { + deserializedCustomDomainProperties.customHttpsProvisioningState + = CustomHttpsProvisioningState.fromString(reader.getString()); + } else if ("customHttpsProvisioningSubstate".equals(fieldName)) { + deserializedCustomDomainProperties.customHttpsProvisioningSubstate + = CustomHttpsProvisioningSubstate.fromString(reader.getString()); + } else if ("customHttpsParameters".equals(fieldName)) { + deserializedCustomDomainProperties.customHttpsParameters + = CustomDomainHttpsParameters.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedCustomDomainProperties.validationData = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCustomDomainProperties.provisioningState + = CustomHttpsProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomainProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainPropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainPropertiesParameters.java new file mode 100644 index 000000000000..2b46d0f1737f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainPropertiesParameters.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The JSON object that contains the properties of the custom domain to create. + */ +@Fluent +public final class CustomDomainPropertiesParameters implements JsonSerializable { + /* + * The host name of the custom domain. Must be a domain name. + */ + private String hostname; + + /** + * Creates an instance of CustomDomainPropertiesParameters class. + */ + public CustomDomainPropertiesParameters() { + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the CustomDomainPropertiesParameters object itself. + */ + public CustomDomainPropertiesParameters withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hostname in model CustomDomainPropertiesParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainPropertiesParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomainPropertiesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomainPropertiesParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomDomainPropertiesParameters. + */ + public static CustomDomainPropertiesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomainPropertiesParameters deserializedCustomDomainPropertiesParameters + = new CustomDomainPropertiesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedCustomDomainPropertiesParameters.hostname = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomainPropertiesParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedCustomDomainProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedCustomDomainProperties.java new file mode 100644 index 000000000000..c8b1c8636a0c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedCustomDomainProperties.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the custom domain created on the CDN endpoint. + */ +@Fluent +public final class DeepCreatedCustomDomainProperties implements JsonSerializable { + /* + * The host name of the custom domain. Must be a domain name. + */ + private String hostname; + + /* + * Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. + * E.g. ICP license number of a custom domain is required to deliver content in China. + */ + private String validationData; + + /** + * Creates an instance of DeepCreatedCustomDomainProperties class. + */ + public DeepCreatedCustomDomainProperties() { + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the DeepCreatedCustomDomainProperties object itself. + */ + public DeepCreatedCustomDomainProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + public String validationData() { + return this.validationData; + } + + /** + * Set the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @param validationData the validationData value to set. + * @return the DeepCreatedCustomDomainProperties object itself. + */ + public DeepCreatedCustomDomainProperties withValidationData(String validationData) { + this.validationData = validationData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hostname in model DeepCreatedCustomDomainProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedCustomDomainProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeStringField("validationData", this.validationData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeepCreatedCustomDomainProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeepCreatedCustomDomainProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeepCreatedCustomDomainProperties. + */ + public static DeepCreatedCustomDomainProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeepCreatedCustomDomainProperties deserializedDeepCreatedCustomDomainProperties + = new DeepCreatedCustomDomainProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedDeepCreatedCustomDomainProperties.hostname = reader.getString(); + } else if ("validationData".equals(fieldName)) { + deserializedDeepCreatedCustomDomainProperties.validationData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeepCreatedCustomDomainProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginGroupProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginGroupProperties.java new file mode 100644 index 000000000000..d364cfdcc884 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginGroupProperties.java @@ -0,0 +1,219 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the origin group created on the CDN endpoint. + */ +@Fluent +public final class DeepCreatedOriginGroupProperties implements JsonSerializable { + /* + * Health probe settings to the origin that is used to determine the health of the origin. + */ + private HealthProbeParameters healthProbeSettings; + + /* + * The source of the content being delivered via CDN within given origin group. + */ + 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. + */ + private Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + + /* + * The JSON object that contains the properties to determine origin health using real requests/responses.This + * property is currently not supported. + */ + private ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings; + + /** + * Creates an instance of DeepCreatedOriginGroupProperties class. + */ + public DeepCreatedOriginGroupProperties() { + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the DeepCreatedOriginGroupProperties object itself. + */ + public DeepCreatedOriginGroupProperties withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.origins; + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the DeepCreatedOriginGroupProperties object itself. + */ + public DeepCreatedOriginGroupProperties withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the DeepCreatedOriginGroupProperties object itself. + */ + public DeepCreatedOriginGroupProperties withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes + = trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses.This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.responseBasedOriginErrorDetectionSettings; + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses.This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the DeepCreatedOriginGroupProperties object itself. + */ + public DeepCreatedOriginGroupProperties withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + this.responseBasedOriginErrorDetectionSettings = responseBasedOriginErrorDetectionSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthProbeSettings() != null) { + healthProbeSettings().validate(); + } + if (origins() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property origins in model DeepCreatedOriginGroupProperties")); + } else { + origins().forEach(e -> e.validate()); + } + if (responseBasedOriginErrorDetectionSettings() != null) { + responseBasedOriginErrorDetectionSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedOriginGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("origins", this.origins, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("healthProbeSettings", this.healthProbeSettings); + jsonWriter.writeNumberField("trafficRestorationTimeToHealedOrNewEndpointsInMinutes", + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + jsonWriter.writeJsonField("responseBasedOriginErrorDetectionSettings", + this.responseBasedOriginErrorDetectionSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeepCreatedOriginGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeepCreatedOriginGroupProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeepCreatedOriginGroupProperties. + */ + public static DeepCreatedOriginGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeepCreatedOriginGroupProperties deserializedDeepCreatedOriginGroupProperties + = new DeepCreatedOriginGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("origins".equals(fieldName)) { + List origins = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); + deserializedDeepCreatedOriginGroupProperties.origins = origins; + } else if ("healthProbeSettings".equals(fieldName)) { + deserializedDeepCreatedOriginGroupProperties.healthProbeSettings + = HealthProbeParameters.fromJson(reader); + } else if ("trafficRestorationTimeToHealedOrNewEndpointsInMinutes".equals(fieldName)) { + deserializedDeepCreatedOriginGroupProperties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("responseBasedOriginErrorDetectionSettings".equals(fieldName)) { + deserializedDeepCreatedOriginGroupProperties.responseBasedOriginErrorDetectionSettings + = ResponseBasedOriginErrorDetectionParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeepCreatedOriginGroupProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginProperties.java new file mode 100644 index 000000000000..88c7b875d263 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginProperties.java @@ -0,0 +1,423 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; +import java.io.IOException; + +/** + * Properties of the origin created on the CDN endpoint. + */ +@Fluent +public final class DeepCreatedOriginProperties implements JsonSerializable { + /* + * 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. + */ + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + 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. + */ + 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. + */ + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 + */ + private Integer weight; + + /* + * Origin is enabled for load balancing or not. By default, origin is always enabled. + */ + private Boolean enabled; + + /* + * The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' + */ + private String privateLinkAlias; + + /* + * The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is + * 'Private' + */ + private String privateLinkResourceId; + + /* + * The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated + */ + private String privateLinkLocation; + + /* + * A custom message to be included in the approval request to connect to the Private Link. + */ + private String privateLinkApprovalMessage; + + /* + * The approval status for the connection to the Private Link + */ + private PrivateEndpointStatus privateEndpointStatus; + + /** + * Creates an instance of DeepCreatedOriginProperties class. + */ + public DeepCreatedOriginProperties() { + } + + /** + * Get the hostname property: The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. By default, origin is always enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. By default, origin is always enabled. + * + * @param enabled the enabled value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.privateLinkAlias; + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPrivateLinkAlias(String privateLinkAlias) { + this.privateLinkAlias = privateLinkAlias; + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.privateLinkResourceId; + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.privateLinkLocation; + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPrivateLinkLocation(String privateLinkLocation) { + this.privateLinkLocation = privateLinkLocation; + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.privateLinkApprovalMessage; + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + this.privateLinkApprovalMessage = privateLinkApprovalMessage; + return this; + } + + /** + * Get the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + public PrivateEndpointStatus privateEndpointStatus() { + return this.privateEndpointStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hostname in model DeepCreatedOriginProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedOriginProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeNumberField("httpPort", this.httpPort); + jsonWriter.writeNumberField("httpsPort", this.httpsPort); + jsonWriter.writeStringField("originHostHeader", this.originHostHeader); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeNumberField("weight", this.weight); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("privateLinkAlias", this.privateLinkAlias); + jsonWriter.writeStringField("privateLinkResourceId", this.privateLinkResourceId); + jsonWriter.writeStringField("privateLinkLocation", this.privateLinkLocation); + jsonWriter.writeStringField("privateLinkApprovalMessage", this.privateLinkApprovalMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeepCreatedOriginProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeepCreatedOriginProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeepCreatedOriginProperties. + */ + public static DeepCreatedOriginProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeepCreatedOriginProperties deserializedDeepCreatedOriginProperties = new DeepCreatedOriginProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.hostname = reader.getString(); + } else if ("httpPort".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.httpPort = reader.getNullable(JsonReader::getInt); + } else if ("httpsPort".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.httpsPort = reader.getNullable(JsonReader::getInt); + } else if ("originHostHeader".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.originHostHeader = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.priority = reader.getNullable(JsonReader::getInt); + } else if ("weight".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.weight = reader.getNullable(JsonReader::getInt); + } else if ("enabled".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("privateLinkAlias".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.privateLinkAlias = reader.getString(); + } else if ("privateLinkResourceId".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.privateLinkResourceId = reader.getString(); + } else if ("privateLinkLocation".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.privateLinkLocation = reader.getString(); + } else if ("privateLinkApprovalMessage".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.privateLinkApprovalMessage = reader.getString(); + } else if ("privateEndpointStatus".equals(fieldName)) { + deserializedDeepCreatedOriginProperties.privateEndpointStatus + = PrivateEndpointStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeepCreatedOriginProperties; + }); + } +} 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 000000000000..2e2a9234b4e3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeInner.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.IpAddressGroup; +import java.io.IOException; +import java.util.List; + +/** + * Edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. + */ +@Fluent +public final class EdgeNodeInner extends ProxyResource { + /* + * The JSON object that contains the properties required to create an edgenode. + */ + private EdgeNodeProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EdgeNodeInner class. + */ + public EdgeNodeInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties required to create an edgenode. + * + * @return the innerProperties value. + */ + private EdgeNodeProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the ipAddressGroups property: List of ip address groups. + * + * @return the ipAddressGroups value. + */ + public List ipAddressGroups() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddressGroups(); + } + + /** + * Set the ipAddressGroups property: List of ip address groups. + * + * @param ipAddressGroups the ipAddressGroups value to set. + * @return the EdgeNodeInner object itself. + */ + public EdgeNodeInner withIpAddressGroups(List ipAddressGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new EdgeNodeProperties(); + } + this.innerProperties().withIpAddressGroups(ipAddressGroups); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeNodeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeNodeInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EdgeNodeInner. + */ + public static EdgeNodeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeNodeInner deserializedEdgeNodeInner = new EdgeNodeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEdgeNodeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEdgeNodeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEdgeNodeInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEdgeNodeInner.innerProperties = EdgeNodeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEdgeNodeInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeNodeInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeProperties.java new file mode 100644 index 000000000000..e8f02f48a16e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.IpAddressGroup; +import java.io.IOException; +import java.util.List; + +/** + * The JSON object that contains the properties required to create an edgenode. + */ +@Fluent +public final class EdgeNodeProperties implements JsonSerializable { + /* + * List of ip address groups. + */ + private List ipAddressGroups; + + /** + * Creates an instance of EdgeNodeProperties class. + */ + public EdgeNodeProperties() { + } + + /** + * Get the ipAddressGroups property: List of ip address groups. + * + * @return the ipAddressGroups value. + */ + public List ipAddressGroups() { + return this.ipAddressGroups; + } + + /** + * Set the ipAddressGroups property: List of ip address groups. + * + * @param ipAddressGroups the ipAddressGroups value to set. + * @return the EdgeNodeProperties object itself. + */ + public EdgeNodeProperties withIpAddressGroups(List ipAddressGroups) { + this.ipAddressGroups = ipAddressGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddressGroups() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ipAddressGroups in model EdgeNodeProperties")); + } else { + ipAddressGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EdgeNodeProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipAddressGroups", this.ipAddressGroups, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeNodeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeNodeProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EdgeNodeProperties. + */ + public static EdgeNodeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeNodeProperties deserializedEdgeNodeProperties = new EdgeNodeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddressGroups".equals(fieldName)) { + List ipAddressGroups + = reader.readArray(reader1 -> IpAddressGroup.fromJson(reader1)); + deserializedEdgeNodeProperties.ipAddressGroups = ipAddressGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeNodeProperties; + }); + } +} 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 000000000000..43fcad9b6f0c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointInner.java @@ -0,0 +1,634 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedCustomDomain; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOrigin; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersDeliveryPolicy; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.cdn.generated.models.EndpointProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.EndpointResourceState; +import com.azure.resourcemanager.cdn.generated.models.GeoFilter; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.QueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.UrlSigningKey; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, + * content caching and delivery behavior. The CDN endpoint uses the URL format <endpointname>.azureedge.net. + */ +@Fluent +public final class EndpointInner extends Resource { + /* + * The JSON object that contains the properties required to create an endpoint. + */ + private EndpointProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EndpointInner class. + */ + public EndpointInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties required to create an endpoint. + * + * @return the innerProperties value. + */ + private EndpointProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Get the origins property: The source of the content being delivered via CDN. + * + * @return the origins value. + */ + public List origins() { + return this.innerProperties() == null ? null : this.innerProperties().origins(); + } + + /** + * Set the origins property: The source of the content being delivered via CDN. + * + * @param origins the origins value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOrigins(List origins) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOrigins(origins); + return this; + } + + /** + * Get the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @return the originGroups value. + */ + public List originGroups() { + return this.innerProperties() == null ? null : this.innerProperties().originGroups(); + } + + /** + * Set the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @param originGroups the originGroups value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOriginGroups(List originGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOriginGroups(originGroups); + return this; + } + + /** + * Get the customDomains property: The custom domains under the endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.innerProperties() == null ? null : this.innerProperties().customDomains(); + } + + /** + * Get the resourceState property: Resource status of the endpoint. + * + * @return the resourceState value. + */ + public EndpointResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the provisioningState property: Provisioning status of the endpoint. + * + * @return the provisioningState value. + */ + public EndpointProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.innerProperties() == null ? null : this.innerProperties().originPath(); + } + + /** + * Set the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOriginPath(String originPath) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOriginPath(originPath); + return this; + } + + /** + * Get the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + public List contentTypesToCompress() { + return this.innerProperties() == null ? null : this.innerProperties().contentTypesToCompress(); + } + + /** + * Set the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withContentTypesToCompress(List contentTypesToCompress) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withContentTypesToCompress(contentTypesToCompress); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public Boolean isCompressionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isCompressionEnabled(); + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withIsCompressionEnabled(Boolean isCompressionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withIsCompressionEnabled(isCompressionEnabled); + return this; + } + + /** + * Get the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value. + */ + public Boolean isHttpAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().isHttpAllowed(); + } + + /** + * Set the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpAllowed the isHttpAllowed value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withIsHttpAllowed(Boolean isHttpAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withIsHttpAllowed(isHttpAllowed); + return this; + } + + /** + * Get the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value. + */ + public Boolean isHttpsAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().isHttpsAllowed(); + } + + /** + * Set the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpsAllowed the isHttpsAllowed value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withIsHttpsAllowed(Boolean isHttpsAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withIsHttpsAllowed(isHttpsAllowed); + return this; + } + + /** + * Get the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @return the queryStringCachingBehavior value. + */ + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().queryStringCachingBehavior(); + } + + /** + * Set the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } + + /** + * Get the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @return the optimizationType value. + */ + public OptimizationType optimizationType() { + return this.innerProperties() == null ? null : this.innerProperties().optimizationType(); + } + + /** + * Set the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @param optimizationType the optimizationType value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOptimizationType(OptimizationType optimizationType) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOptimizationType(optimizationType); + return this; + } + + /** + * Get the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @return the probePath value. + */ + public String probePath() { + return this.innerProperties() == null ? null : this.innerProperties().probePath(); + } + + /** + * Set the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @param probePath the probePath value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withProbePath(String probePath) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withProbePath(probePath); + return this; + } + + /** + * Get the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value. + */ + public List geoFilters() { + return this.innerProperties() == null ? null : this.innerProperties().geoFilters(); + } + + /** + * Set the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @param geoFilters the geoFilters value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withGeoFilters(List geoFilters) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withGeoFilters(geoFilters); + return this; + } + + /** + * Get the defaultOriginGroup property: A reference to the origin group. + * + * @return the defaultOriginGroup value. + */ + public ResourceReference defaultOriginGroup() { + return this.innerProperties() == null ? null : this.innerProperties().defaultOriginGroup(); + } + + /** + * Set the defaultOriginGroup property: A reference to the origin group. + * + * @param defaultOriginGroup the defaultOriginGroup value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withDefaultOriginGroup(defaultOriginGroup); + return this; + } + + /** + * Get the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @return the urlSigningKeys value. + */ + public List urlSigningKeys() { + return this.innerProperties() == null ? null : this.innerProperties().urlSigningKeys(); + } + + /** + * Set the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @param urlSigningKeys the urlSigningKeys value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withUrlSigningKeys(List urlSigningKeys) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withUrlSigningKeys(urlSigningKeys); + return this; + } + + /** + * Get the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().deliveryPolicy(); + } + + /** + * Set the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @param deliveryPolicy the deliveryPolicy value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withDeliveryPolicy(deliveryPolicy); + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.innerProperties() == null ? null : this.innerProperties().webApplicationFirewallPolicyLink(); + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EndpointInner. + */ + public static EndpointInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointInner deserializedEndpointInner = new EndpointInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEndpointInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEndpointInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEndpointInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEndpointInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEndpointInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEndpointInner.innerProperties = EndpointProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEndpointInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointProperties.java new file mode 100644 index 000000000000..3e51a8ccf786 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointProperties.java @@ -0,0 +1,417 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedCustomDomain; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOrigin; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersDeliveryPolicy; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.cdn.generated.models.EndpointProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.EndpointResourceState; +import com.azure.resourcemanager.cdn.generated.models.GeoFilter; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.QueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.UrlSigningKey; +import java.io.IOException; +import java.util.List; + +/** + * The JSON object that contains the properties required to create an endpoint. + */ +@Fluent +public final class EndpointProperties extends EndpointPropertiesUpdateParameters { + /* + * The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net + */ + private String hostname; + + /* + * The source of the content being delivered via CDN. + */ + private List origins; + + /* + * The origin groups comprising of origins that are used for load balancing the traffic based on availability. + */ + private List originGroups; + + /* + * The custom domains under the endpoint. + */ + private List customDomains; + + /* + * Resource status of the endpoint. + */ + private EndpointResourceState resourceState; + + /* + * Provisioning status of the endpoint. + */ + private EndpointProvisioningState provisioningState; + + /** + * Creates an instance of EndpointProperties class. + */ + public EndpointProperties() { + } + + /** + * Get the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the origins property: The source of the content being delivered via CDN. + * + * @return the origins value. + */ + public List origins() { + return this.origins; + } + + /** + * Set the origins property: The source of the content being delivered via CDN. + * + * @param origins the origins value to set. + * @return the EndpointProperties object itself. + */ + public EndpointProperties withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @return the originGroups value. + */ + public List originGroups() { + return this.originGroups; + } + + /** + * Set the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @param originGroups the originGroups value to set. + * @return the EndpointProperties object itself. + */ + public EndpointProperties withOriginGroups(List originGroups) { + this.originGroups = originGroups; + return this; + } + + /** + * Get the customDomains property: The custom domains under the endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.customDomains; + } + + /** + * Get the resourceState property: Resource status of the endpoint. + * + * @return the resourceState value. + */ + public EndpointResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning status of the endpoint. + * + * @return the provisioningState value. + */ + public EndpointProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withOriginPath(String originPath) { + super.withOriginPath(originPath); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withContentTypesToCompress(List contentTypesToCompress) { + super.withContentTypesToCompress(contentTypesToCompress); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withOriginHostHeader(String originHostHeader) { + super.withOriginHostHeader(originHostHeader); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withIsCompressionEnabled(Boolean isCompressionEnabled) { + super.withIsCompressionEnabled(isCompressionEnabled); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withIsHttpAllowed(Boolean isHttpAllowed) { + super.withIsHttpAllowed(isHttpAllowed); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withIsHttpsAllowed(Boolean isHttpsAllowed) { + super.withIsHttpsAllowed(isHttpsAllowed); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + super.withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withOptimizationType(OptimizationType optimizationType) { + super.withOptimizationType(optimizationType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withProbePath(String probePath) { + super.withProbePath(probePath); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withGeoFilters(List geoFilters) { + super.withGeoFilters(geoFilters); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + super.withDefaultOriginGroup(defaultOriginGroup); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withUrlSigningKeys(List urlSigningKeys) { + super.withUrlSigningKeys(urlSigningKeys); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + super.withDeliveryPolicy(deliveryPolicy); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EndpointProperties withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + super.withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (origins() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property origins in model EndpointProperties")); + } else { + origins().forEach(e -> e.validate()); + } + if (originGroups() != null) { + originGroups().forEach(e -> e.validate()); + } + if (customDomains() != null) { + customDomains().forEach(e -> e.validate()); + } + 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EndpointProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("originPath", originPath()); + jsonWriter.writeArrayField("contentTypesToCompress", contentTypesToCompress(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("originHostHeader", originHostHeader()); + jsonWriter.writeBooleanField("isCompressionEnabled", isCompressionEnabled()); + jsonWriter.writeBooleanField("isHttpAllowed", isHttpAllowed()); + jsonWriter.writeBooleanField("isHttpsAllowed", isHttpsAllowed()); + jsonWriter.writeStringField("queryStringCachingBehavior", + queryStringCachingBehavior() == null ? null : queryStringCachingBehavior().toString()); + jsonWriter.writeStringField("optimizationType", + optimizationType() == null ? null : optimizationType().toString()); + jsonWriter.writeStringField("probePath", probePath()); + jsonWriter.writeArrayField("geoFilters", geoFilters(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("defaultOriginGroup", defaultOriginGroup()); + jsonWriter.writeArrayField("urlSigningKeys", urlSigningKeys(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("deliveryPolicy", deliveryPolicy()); + jsonWriter.writeJsonField("webApplicationFirewallPolicyLink", webApplicationFirewallPolicyLink()); + jsonWriter.writeArrayField("origins", this.origins, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("originGroups", this.originGroups, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EndpointProperties. + */ + public static EndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointProperties deserializedEndpointProperties = new EndpointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("originPath".equals(fieldName)) { + deserializedEndpointProperties.withOriginPath(reader.getString()); + } else if ("contentTypesToCompress".equals(fieldName)) { + List contentTypesToCompress = reader.readArray(reader1 -> reader1.getString()); + deserializedEndpointProperties.withContentTypesToCompress(contentTypesToCompress); + } else if ("originHostHeader".equals(fieldName)) { + deserializedEndpointProperties.withOriginHostHeader(reader.getString()); + } else if ("isCompressionEnabled".equals(fieldName)) { + deserializedEndpointProperties.withIsCompressionEnabled(reader.getNullable(JsonReader::getBoolean)); + } else if ("isHttpAllowed".equals(fieldName)) { + deserializedEndpointProperties.withIsHttpAllowed(reader.getNullable(JsonReader::getBoolean)); + } else if ("isHttpsAllowed".equals(fieldName)) { + deserializedEndpointProperties.withIsHttpsAllowed(reader.getNullable(JsonReader::getBoolean)); + } else if ("queryStringCachingBehavior".equals(fieldName)) { + deserializedEndpointProperties + .withQueryStringCachingBehavior(QueryStringCachingBehavior.fromString(reader.getString())); + } else if ("optimizationType".equals(fieldName)) { + deserializedEndpointProperties + .withOptimizationType(OptimizationType.fromString(reader.getString())); + } else if ("probePath".equals(fieldName)) { + deserializedEndpointProperties.withProbePath(reader.getString()); + } else if ("geoFilters".equals(fieldName)) { + List geoFilters = reader.readArray(reader1 -> GeoFilter.fromJson(reader1)); + deserializedEndpointProperties.withGeoFilters(geoFilters); + } else if ("defaultOriginGroup".equals(fieldName)) { + deserializedEndpointProperties.withDefaultOriginGroup(ResourceReference.fromJson(reader)); + } else if ("urlSigningKeys".equals(fieldName)) { + List urlSigningKeys = reader.readArray(reader1 -> UrlSigningKey.fromJson(reader1)); + deserializedEndpointProperties.withUrlSigningKeys(urlSigningKeys); + } else if ("deliveryPolicy".equals(fieldName)) { + deserializedEndpointProperties + .withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy.fromJson(reader)); + } else if ("webApplicationFirewallPolicyLink".equals(fieldName)) { + deserializedEndpointProperties.withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.fromJson(reader)); + } else if ("origins".equals(fieldName)) { + List origins = reader.readArray(reader1 -> DeepCreatedOrigin.fromJson(reader1)); + deserializedEndpointProperties.origins = origins; + } else if ("hostName".equals(fieldName)) { + deserializedEndpointProperties.hostname = reader.getString(); + } else if ("originGroups".equals(fieldName)) { + List originGroups + = reader.readArray(reader1 -> DeepCreatedOriginGroup.fromJson(reader1)); + deserializedEndpointProperties.originGroups = originGroups; + } else if ("customDomains".equals(fieldName)) { + List customDomains + = reader.readArray(reader1 -> DeepCreatedCustomDomain.fromJson(reader1)); + deserializedEndpointProperties.customDomains = customDomains; + } else if ("resourceState".equals(fieldName)) { + deserializedEndpointProperties.resourceState = EndpointResourceState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedEndpointProperties.provisioningState + = EndpointProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointPropertiesUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointPropertiesUpdateParameters.java new file mode 100644 index 000000000000..e9aea5a5f4fb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointPropertiesUpdateParameters.java @@ -0,0 +1,544 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersDeliveryPolicy; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.cdn.generated.models.GeoFilter; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.QueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.UrlSigningKey; +import java.io.IOException; +import java.util.List; + +/** + * The JSON object containing endpoint update parameters. + */ +@Fluent +public class EndpointPropertiesUpdateParameters implements JsonSerializable { + /* + * A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. + */ + private String originPath; + + /* + * List of content types on which compression applies. The value should be a valid MIME type. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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/ + */ + private List geoFilters; + + /* + * A reference to the origin group. + */ + private ResourceReference defaultOriginGroup; + + /* + * List of keys used to validate the signed URL hashes. + */ + private List urlSigningKeys; + + /* + * A policy that specifies the delivery rules to be used for an endpoint. + */ + private EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy; + + /* + * Defines the Web Application Firewall policy for the endpoint (if applicable) + */ + private EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink; + + /** + * Creates an instance of EndpointPropertiesUpdateParameters class. + */ + public EndpointPropertiesUpdateParameters() { + } + + /** + * Get the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.originPath; + } + + /** + * Set the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withOriginPath(String originPath) { + this.originPath = originPath; + return this; + } + + /** + * Get the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + public List contentTypesToCompress() { + return this.contentTypesToCompress; + } + + /** + * Set the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withContentTypesToCompress(List contentTypesToCompress) { + this.contentTypesToCompress = contentTypesToCompress; + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public Boolean isCompressionEnabled() { + return this.isCompressionEnabled; + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withIsCompressionEnabled(Boolean isCompressionEnabled) { + this.isCompressionEnabled = isCompressionEnabled; + return this; + } + + /** + * Get the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value. + */ + public Boolean isHttpAllowed() { + return this.isHttpAllowed; + } + + /** + * Set the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpAllowed the isHttpAllowed value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withIsHttpAllowed(Boolean isHttpAllowed) { + this.isHttpAllowed = isHttpAllowed; + return this; + } + + /** + * Get the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value. + */ + public Boolean isHttpsAllowed() { + return this.isHttpsAllowed; + } + + /** + * Set the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpsAllowed the isHttpsAllowed value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withIsHttpsAllowed(Boolean isHttpsAllowed) { + this.isHttpsAllowed = isHttpsAllowed; + return this; + } + + /** + * Get the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @return the queryStringCachingBehavior value. + */ + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.queryStringCachingBehavior; + } + + /** + * Set the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters + withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + return this; + } + + /** + * Get the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @return the optimizationType value. + */ + public OptimizationType optimizationType() { + return this.optimizationType; + } + + /** + * Set the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @param optimizationType the optimizationType value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withOptimizationType(OptimizationType optimizationType) { + this.optimizationType = optimizationType; + return this; + } + + /** + * Get the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @return the probePath value. + */ + public String probePath() { + return this.probePath; + } + + /** + * Set the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @param probePath the probePath value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withProbePath(String probePath) { + this.probePath = probePath; + return this; + } + + /** + * Get the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value. + */ + public List geoFilters() { + return this.geoFilters; + } + + /** + * Set the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @param geoFilters the geoFilters value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withGeoFilters(List geoFilters) { + this.geoFilters = geoFilters; + return this; + } + + /** + * Get the defaultOriginGroup property: A reference to the origin group. + * + * @return the defaultOriginGroup value. + */ + public ResourceReference defaultOriginGroup() { + return this.defaultOriginGroup; + } + + /** + * Set the defaultOriginGroup property: A reference to the origin group. + * + * @param defaultOriginGroup the defaultOriginGroup value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + this.defaultOriginGroup = defaultOriginGroup; + return this; + } + + /** + * Get the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @return the urlSigningKeys value. + */ + public List urlSigningKeys() { + return this.urlSigningKeys; + } + + /** + * Set the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @param urlSigningKeys the urlSigningKeys value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withUrlSigningKeys(List urlSigningKeys) { + this.urlSigningKeys = urlSigningKeys; + return this; + } + + /** + * Get the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.deliveryPolicy; + } + + /** + * Set the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @param deliveryPolicy the deliveryPolicy value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters + withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + this.deliveryPolicy = deliveryPolicy; + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.webApplicationFirewallPolicyLink; + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + this.webApplicationFirewallPolicyLink = webApplicationFirewallPolicyLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (geoFilters() != null) { + geoFilters().forEach(e -> e.validate()); + } + if (defaultOriginGroup() != null) { + defaultOriginGroup().validate(); + } + if (urlSigningKeys() != null) { + urlSigningKeys().forEach(e -> e.validate()); + } + if (deliveryPolicy() != null) { + deliveryPolicy().validate(); + } + if (webApplicationFirewallPolicyLink() != null) { + webApplicationFirewallPolicyLink().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("originPath", this.originPath); + jsonWriter.writeArrayField("contentTypesToCompress", this.contentTypesToCompress, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("originHostHeader", this.originHostHeader); + jsonWriter.writeBooleanField("isCompressionEnabled", this.isCompressionEnabled); + jsonWriter.writeBooleanField("isHttpAllowed", this.isHttpAllowed); + jsonWriter.writeBooleanField("isHttpsAllowed", this.isHttpsAllowed); + jsonWriter.writeStringField("queryStringCachingBehavior", + this.queryStringCachingBehavior == null ? null : this.queryStringCachingBehavior.toString()); + jsonWriter.writeStringField("optimizationType", + this.optimizationType == null ? null : this.optimizationType.toString()); + jsonWriter.writeStringField("probePath", this.probePath); + jsonWriter.writeArrayField("geoFilters", this.geoFilters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("defaultOriginGroup", this.defaultOriginGroup); + jsonWriter.writeArrayField("urlSigningKeys", this.urlSigningKeys, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("deliveryPolicy", this.deliveryPolicy); + jsonWriter.writeJsonField("webApplicationFirewallPolicyLink", this.webApplicationFirewallPolicyLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointPropertiesUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointPropertiesUpdateParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointPropertiesUpdateParameters. + */ + public static EndpointPropertiesUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointPropertiesUpdateParameters deserializedEndpointPropertiesUpdateParameters + = new EndpointPropertiesUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("originPath".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.originPath = reader.getString(); + } else if ("contentTypesToCompress".equals(fieldName)) { + List contentTypesToCompress = reader.readArray(reader1 -> reader1.getString()); + deserializedEndpointPropertiesUpdateParameters.contentTypesToCompress = contentTypesToCompress; + } else if ("originHostHeader".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.originHostHeader = reader.getString(); + } else if ("isCompressionEnabled".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.isCompressionEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("isHttpAllowed".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.isHttpAllowed + = reader.getNullable(JsonReader::getBoolean); + } else if ("isHttpsAllowed".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.isHttpsAllowed + = reader.getNullable(JsonReader::getBoolean); + } else if ("queryStringCachingBehavior".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.queryStringCachingBehavior + = QueryStringCachingBehavior.fromString(reader.getString()); + } else if ("optimizationType".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.optimizationType + = OptimizationType.fromString(reader.getString()); + } else if ("probePath".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.probePath = reader.getString(); + } else if ("geoFilters".equals(fieldName)) { + List geoFilters = reader.readArray(reader1 -> GeoFilter.fromJson(reader1)); + deserializedEndpointPropertiesUpdateParameters.geoFilters = geoFilters; + } else if ("defaultOriginGroup".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.defaultOriginGroup + = ResourceReference.fromJson(reader); + } else if ("urlSigningKeys".equals(fieldName)) { + List urlSigningKeys = reader.readArray(reader1 -> UrlSigningKey.fromJson(reader1)); + deserializedEndpointPropertiesUpdateParameters.urlSigningKeys = urlSigningKeys; + } else if ("deliveryPolicy".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.deliveryPolicy + = EndpointPropertiesUpdateParametersDeliveryPolicy.fromJson(reader); + } else if ("webApplicationFirewallPolicyLink".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParameters.webApplicationFirewallPolicyLink + = EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointPropertiesUpdateParameters; + }); + } +} 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 000000000000..b2be5db1f3bf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionInner.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupDefinition; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import java.io.IOException; +import java.util.List; + +/** + * Describes a managed rule set definition. + */ +@Fluent +public final class ManagedRuleSetDefinitionInner extends ProxyResource { + /* + * Describes managed rule set definition properties. + */ + private ManagedRuleSetDefinitionProperties innerProperties; + + /* + * The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. + */ + private Sku sku; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ManagedRuleSetDefinitionInner class. + */ + public ManagedRuleSetDefinitionInner() { + } + + /** + * Get the innerProperties property: Describes managed rule set definition properties. + * + * @return the innerProperties value. + */ + private ManagedRuleSetDefinitionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @param sku the sku value to set. + * @return the ManagedRuleSetDefinitionInner object itself. + */ + public ManagedRuleSetDefinitionInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: Provisioning state of the managed rule set. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ruleSetType property: Type of the managed rule set. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSetType(); + } + + /** + * Get the ruleSetVersion property: Version of the managed rule set type. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSetVersion(); + } + + /** + * Get the ruleGroups property: Rule groups of the managed rule set. + * + * @return the ruleGroups value. + */ + public List ruleGroups() { + return this.innerProperties() == null ? null : this.innerProperties().ruleGroups(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleSetDefinitionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleSetDefinitionInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedRuleSetDefinitionInner. + */ + public static ManagedRuleSetDefinitionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleSetDefinitionInner deserializedManagedRuleSetDefinitionInner + = new ManagedRuleSetDefinitionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedRuleSetDefinitionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedRuleSetDefinitionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedRuleSetDefinitionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedManagedRuleSetDefinitionInner.innerProperties + = ManagedRuleSetDefinitionProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedManagedRuleSetDefinitionInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedManagedRuleSetDefinitionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleSetDefinitionInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionProperties.java new file mode 100644 index 000000000000..1786b297e432 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupDefinition; +import java.io.IOException; +import java.util.List; + +/** + * Properties for a managed rule set definition. + */ +@Immutable +public final class ManagedRuleSetDefinitionProperties implements JsonSerializable { + /* + * Provisioning state of the managed rule set. + */ + private String provisioningState; + + /* + * Type of the managed rule set. + */ + private String ruleSetType; + + /* + * Version of the managed rule set type. + */ + private String ruleSetVersion; + + /* + * Rule groups of the managed rule set. + */ + private List ruleGroups; + + /** + * Creates an instance of ManagedRuleSetDefinitionProperties class. + */ + public ManagedRuleSetDefinitionProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the managed rule set. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the ruleSetType property: Type of the managed rule set. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Get the ruleSetVersion property: Version of the managed rule set type. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Get the ruleGroups property: Rule groups of the managed rule set. + * + * @return the ruleGroups value. + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleSetDefinitionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleSetDefinitionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedRuleSetDefinitionProperties. + */ + public static ManagedRuleSetDefinitionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleSetDefinitionProperties deserializedManagedRuleSetDefinitionProperties + = new ManagedRuleSetDefinitionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedManagedRuleSetDefinitionProperties.provisioningState = reader.getString(); + } else if ("ruleSetType".equals(fieldName)) { + deserializedManagedRuleSetDefinitionProperties.ruleSetType = reader.getString(); + } else if ("ruleSetVersion".equals(fieldName)) { + deserializedManagedRuleSetDefinitionProperties.ruleSetVersion = reader.getString(); + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ManagedRuleGroupDefinition.fromJson(reader1)); + deserializedManagedRuleSetDefinitionProperties.ruleGroups = ruleGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleSetDefinitionProperties; + }); + } +} 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 000000000000..cd52344a42a2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MetricsResponseInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.MetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponseSeriesItem; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Metrics Response. + */ +@Fluent +public final class MetricsResponseInner implements JsonSerializable { + /* + * The dateTimeBegin property. + */ + private OffsetDateTime dateTimeBegin; + + /* + * The dateTimeEnd property. + */ + private OffsetDateTime dateTimeEnd; + + /* + * The granularity property. + */ + private MetricsGranularity granularity; + + /* + * The series property. + */ + private List series; + + /** + * Creates an instance of MetricsResponseInner class. + */ + public MetricsResponseInner() { + } + + /** + * Get the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + public OffsetDateTime dateTimeBegin() { + return this.dateTimeBegin; + } + + /** + * Set the dateTimeBegin property: The dateTimeBegin property. + * + * @param dateTimeBegin the dateTimeBegin value to set. + * @return the MetricsResponseInner object itself. + */ + public MetricsResponseInner withDateTimeBegin(OffsetDateTime dateTimeBegin) { + this.dateTimeBegin = dateTimeBegin; + return this; + } + + /** + * Get the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + public OffsetDateTime dateTimeEnd() { + return this.dateTimeEnd; + } + + /** + * Set the dateTimeEnd property: The dateTimeEnd property. + * + * @param dateTimeEnd the dateTimeEnd value to set. + * @return the MetricsResponseInner object itself. + */ + public MetricsResponseInner withDateTimeEnd(OffsetDateTime dateTimeEnd) { + this.dateTimeEnd = dateTimeEnd; + return this; + } + + /** + * Get the granularity property: The granularity property. + * + * @return the granularity value. + */ + public MetricsGranularity granularity() { + return this.granularity; + } + + /** + * Set the granularity property: The granularity property. + * + * @param granularity the granularity value to set. + * @return the MetricsResponseInner object itself. + */ + public MetricsResponseInner withGranularity(MetricsGranularity granularity) { + this.granularity = granularity; + return this; + } + + /** + * Get the series property: The series property. + * + * @return the series value. + */ + public List series() { + return this.series; + } + + /** + * Set the series property: The series property. + * + * @param series the series value to set. + * @return the MetricsResponseInner object itself. + */ + public MetricsResponseInner withSeries(List series) { + this.series = series; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (series() != null) { + series().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dateTimeBegin", + this.dateTimeBegin == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTimeBegin)); + jsonWriter.writeStringField("dateTimeEnd", + this.dateTimeEnd == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTimeEnd)); + jsonWriter.writeStringField("granularity", this.granularity == null ? null : this.granularity.toString()); + jsonWriter.writeArrayField("series", this.series, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricsResponseInner. + */ + public static MetricsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsResponseInner deserializedMetricsResponseInner = new MetricsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dateTimeBegin".equals(fieldName)) { + deserializedMetricsResponseInner.dateTimeBegin = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dateTimeEnd".equals(fieldName)) { + deserializedMetricsResponseInner.dateTimeEnd = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("granularity".equals(fieldName)) { + deserializedMetricsResponseInner.granularity = MetricsGranularity.fromString(reader.getString()); + } else if ("series".equals(fieldName)) { + List series + = reader.readArray(reader1 -> MetricsResponseSeriesItem.fromJson(reader1)); + deserializedMetricsResponseInner.series = series; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsResponseInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultInner.java new file mode 100644 index 000000000000..1fea53400ba1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.io.IOException; + +/** + * Result for migrate operation. + */ +@Immutable +public final class MigrateResultInner implements JsonSerializable { + /* + * Resource ID. + */ + private String id; + + /* + * Resource type. + */ + private String type; + + /* + * The properties property. + */ + private MigrateResultProperties innerProperties; + + /** + * Creates an instance of MigrateResultInner class. + */ + public MigrateResultInner() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private MigrateResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the migratedProfileResourceId property: Arm resource id of the migrated profile. + * + * @return the migratedProfileResourceId value. + */ + public ResourceReference migratedProfileResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().migratedProfileResourceId(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateResultInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateResultInner. + */ + public static MigrateResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateResultInner deserializedMigrateResultInner = new MigrateResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateResultInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMigrateResultInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMigrateResultInner.innerProperties = MigrateResultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateResultInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultProperties.java new file mode 100644 index 000000000000..6e3b5621a505 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultProperties.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.io.IOException; + +/** + * The MigrateResultProperties model. + */ +@Immutable +public final class MigrateResultProperties implements JsonSerializable { + /* + * Arm resource id of the migrated profile + */ + private ResourceReference migratedProfileResourceId; + + /** + * Creates an instance of MigrateResultProperties class. + */ + public MigrateResultProperties() { + } + + /** + * Get the migratedProfileResourceId property: Arm resource id of the migrated profile. + * + * @return the migratedProfileResourceId value. + */ + public ResourceReference migratedProfileResourceId() { + return this.migratedProfileResourceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migratedProfileResourceId() != null) { + migratedProfileResourceId().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateResultProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateResultProperties. + */ + public static MigrateResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateResultProperties deserializedMigrateResultProperties = new MigrateResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migratedProfileResourceId".equals(fieldName)) { + deserializedMigrateResultProperties.migratedProfileResourceId = ResourceReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateResultProperties; + }); + } +} 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 000000000000..082ab372fb64 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationInner.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.OperationDisplay; +import com.azure.resourcemanager.cdn.generated.models.ServiceSpecification; +import java.io.IOException; + +/** + * CDN REST API operation. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * Operation name: {provider}/{resource}/{operation} + */ + private String name; + + /* + * Indicates whether the operation is a data action + */ + private Boolean isDataAction; + + /* + * The object that represents the operation. + */ + private OperationDisplay display; + + /* + * The origin of operations. + */ + private String origin; + + /* + * Properties of operation, include metric specifications. + */ + private OperationProperties innerOperationProperties; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that represents the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The origin of operations. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the innerOperationProperties property: Properties of operation, include metric specifications. + * + * @return the innerOperationProperties value. + */ + private OperationProperties innerOperationProperties() { + return this.innerOperationProperties; + } + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.innerOperationProperties() == null ? null : this.innerOperationProperties().serviceSpecification(); + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + if (this.innerOperationProperties() == null) { + this.innerOperationProperties = new OperationProperties(); + } + this.innerOperationProperties().withServiceSpecification(serviceSpecification); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (innerOperationProperties() != null) { + innerOperationProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeJsonField("properties", this.innerOperationProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOperationInner.innerOperationProperties = OperationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationProperties.java new file mode 100644 index 000000000000..9dd6400a5771 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ServiceSpecification; +import java.io.IOException; + +/** + * Properties of operation, include metric specifications. + */ +@Fluent +public final class OperationProperties implements JsonSerializable { + /* + * One property of operation, include metric specifications. + */ + private ServiceSpecification serviceSpecification; + + /** + * Creates an instance of OperationProperties class. + */ + public OperationProperties() { + } + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationProperties. + */ + public static OperationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationProperties deserializedOperationProperties = new OperationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSpecification".equals(fieldName)) { + deserializedOperationProperties.serviceSpecification = ServiceSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationProperties; + }); + } +} diff --git a/sdk/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 000000000000..16f84bc3973f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupResourceState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.io.IOException; +import java.util.List; + +/** + * Origin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. + */ +@Fluent +public final class OriginGroupInner extends ProxyResource { + /* + * The JSON object that contains the properties of the origin group. + */ + private OriginGroupProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OriginGroupInner class. + */ + public OriginGroupInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin group. + * + * @return the innerProperties value. + */ + private OriginGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the resourceState property: Resource status of the origin group. + * + * @return the resourceState value. + */ + public OriginGroupResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the provisioningState property: Provisioning status of the origin group. + * + * @return the provisioningState value. + */ + public OriginGroupProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the OriginGroupInner object itself. + */ + public OriginGroupInner withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupProperties(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.innerProperties() == null ? null : this.innerProperties().origins(); + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the OriginGroupInner object itself. + */ + public OriginGroupInner withOrigins(List origins) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupProperties(); + } + this.innerProperties().withOrigins(origins); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the OriginGroupInner object itself. + */ + public OriginGroupInner withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupProperties(); + } + this.innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.innerProperties() == null + ? null + : this.innerProperties().responseBasedOriginErrorDetectionSettings(); + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the OriginGroupInner object itself. + */ + public OriginGroupInner withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupProperties(); + } + this.innerProperties().withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OriginGroupInner. + */ + public static OriginGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupInner deserializedOriginGroupInner = new OriginGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOriginGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOriginGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOriginGroupInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOriginGroupInner.innerProperties = OriginGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOriginGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupProperties.java new file mode 100644 index 000000000000..839c38d4881f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupResourceState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.io.IOException; +import java.util.List; + +/** + * The JSON object that contains the properties of the origin group. + */ +@Fluent +public final class OriginGroupProperties extends OriginGroupUpdatePropertiesParameters { + /* + * Resource status of the origin group. + */ + private OriginGroupResourceState resourceState; + + /* + * Provisioning status of the origin group. + */ + private OriginGroupProvisioningState provisioningState; + + /** + * Creates an instance of OriginGroupProperties class. + */ + public OriginGroupProperties() { + } + + /** + * Get the resourceState property: Resource status of the origin group. + * + * @return the resourceState value. + */ + public OriginGroupResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning status of the origin group. + * + * @return the provisioningState value. + */ + public OriginGroupProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginGroupProperties withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + super.withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginGroupProperties withOrigins(List origins) { + super.withOrigins(origins); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginGroupProperties withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + super.withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginGroupProperties withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + super.withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (healthProbeSettings() != null) { + healthProbeSettings().validate(); + } + if (origins() != null) { + origins().forEach(e -> e.validate()); + } + if (responseBasedOriginErrorDetectionSettings() != null) { + responseBasedOriginErrorDetectionSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("healthProbeSettings", healthProbeSettings()); + jsonWriter.writeArrayField("origins", origins(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("trafficRestorationTimeToHealedOrNewEndpointsInMinutes", + trafficRestorationTimeToHealedOrNewEndpointsInMinutes()); + jsonWriter.writeJsonField("responseBasedOriginErrorDetectionSettings", + responseBasedOriginErrorDetectionSettings()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroupProperties. + */ + public static OriginGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupProperties deserializedOriginGroupProperties = new OriginGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("healthProbeSettings".equals(fieldName)) { + deserializedOriginGroupProperties.withHealthProbeSettings(HealthProbeParameters.fromJson(reader)); + } else if ("origins".equals(fieldName)) { + List origins = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); + deserializedOriginGroupProperties.withOrigins(origins); + } else if ("trafficRestorationTimeToHealedOrNewEndpointsInMinutes".equals(fieldName)) { + deserializedOriginGroupProperties.withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + reader.getNullable(JsonReader::getInt)); + } else if ("responseBasedOriginErrorDetectionSettings".equals(fieldName)) { + deserializedOriginGroupProperties.withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters.fromJson(reader)); + } else if ("resourceState".equals(fieldName)) { + deserializedOriginGroupProperties.resourceState + = OriginGroupResourceState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedOriginGroupProperties.provisioningState + = OriginGroupProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupUpdatePropertiesParameters.java new file mode 100644 index 000000000000..8b4741b64e90 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupUpdatePropertiesParameters.java @@ -0,0 +1,211 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.io.IOException; +import java.util.List; + +/** + * The JSON object that contains the properties of the origin group. + */ +@Fluent +public class OriginGroupUpdatePropertiesParameters implements JsonSerializable { + /* + * Health probe settings to the origin that is used to determine the health of the origin. + */ + private HealthProbeParameters healthProbeSettings; + + /* + * The source of the content being delivered via CDN within given origin group. + */ + 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. + */ + private Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + + /* + * The JSON object that contains the properties to determine origin health using real requests/responses. This + * property is currently not supported. + */ + private ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings; + + /** + * Creates an instance of OriginGroupUpdatePropertiesParameters class. + */ + public OriginGroupUpdatePropertiesParameters() { + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the OriginGroupUpdatePropertiesParameters object itself. + */ + public OriginGroupUpdatePropertiesParameters withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.origins; + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the OriginGroupUpdatePropertiesParameters object itself. + */ + public OriginGroupUpdatePropertiesParameters withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the OriginGroupUpdatePropertiesParameters object itself. + */ + public OriginGroupUpdatePropertiesParameters withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes + = trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.responseBasedOriginErrorDetectionSettings; + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the OriginGroupUpdatePropertiesParameters object itself. + */ + public OriginGroupUpdatePropertiesParameters withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + this.responseBasedOriginErrorDetectionSettings = responseBasedOriginErrorDetectionSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthProbeSettings() != null) { + healthProbeSettings().validate(); + } + if (origins() != null) { + origins().forEach(e -> e.validate()); + } + if (responseBasedOriginErrorDetectionSettings() != null) { + responseBasedOriginErrorDetectionSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("healthProbeSettings", this.healthProbeSettings); + jsonWriter.writeArrayField("origins", this.origins, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("trafficRestorationTimeToHealedOrNewEndpointsInMinutes", + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + jsonWriter.writeJsonField("responseBasedOriginErrorDetectionSettings", + this.responseBasedOriginErrorDetectionSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupUpdatePropertiesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupUpdatePropertiesParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroupUpdatePropertiesParameters. + */ + public static OriginGroupUpdatePropertiesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupUpdatePropertiesParameters deserializedOriginGroupUpdatePropertiesParameters + = new OriginGroupUpdatePropertiesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("healthProbeSettings".equals(fieldName)) { + deserializedOriginGroupUpdatePropertiesParameters.healthProbeSettings + = HealthProbeParameters.fromJson(reader); + } else if ("origins".equals(fieldName)) { + List origins = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); + deserializedOriginGroupUpdatePropertiesParameters.origins = origins; + } else if ("trafficRestorationTimeToHealedOrNewEndpointsInMinutes".equals(fieldName)) { + deserializedOriginGroupUpdatePropertiesParameters.trafficRestorationTimeToHealedOrNewEndpointsInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("responseBasedOriginErrorDetectionSettings".equals(fieldName)) { + deserializedOriginGroupUpdatePropertiesParameters.responseBasedOriginErrorDetectionSettings + = ResponseBasedOriginErrorDetectionParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupUpdatePropertiesParameters; + }); + } +} 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 000000000000..93465c3c713f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginInner.java @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.OriginProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginResourceState; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; +import java.io.IOException; + +/** + * CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do + * not have the requested content cached, they attempt to fetch it from one or more of the configured origins. + */ +@Fluent +public final class OriginInner extends ProxyResource { + /* + * The JSON object that contains the properties of the origin. + */ + private OriginProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OriginInner class. + */ + public OriginInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin. + * + * @return the innerProperties value. + */ + private OriginProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the resourceState property: Resource status of the origin. + * + * @return the resourceState value. + */ + public OriginResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the provisioningState property: Provisioning status of the origin. + * + * @return the provisioningState value. + */ + public OriginProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + public PrivateEndpointStatus privateEndpointStatus() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointStatus(); + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the OriginInner object itself. + */ + public OriginInner withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the OriginInner object itself. + */ + public OriginInner withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the OriginInner object itself. + */ + public OriginInner withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the OriginInner object itself. + */ + public OriginInner withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the OriginInner object itself. + */ + public OriginInner withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled the enabled value to set. + * @return the OriginInner object itself. + */ + public OriginInner withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkAlias(); + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPrivateLinkAlias(String privateLinkAlias) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPrivateLinkAlias(privateLinkAlias); + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId(); + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPrivateLinkResourceId(String privateLinkResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkLocation(); + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPrivateLinkLocation(String privateLinkLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPrivateLinkLocation(privateLinkLocation); + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkApprovalMessage(); + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OriginInner. + */ + public static OriginInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginInner deserializedOriginInner = new OriginInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOriginInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOriginInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOriginInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOriginInner.innerProperties = OriginProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOriginInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginProperties.java new file mode 100644 index 000000000000..dc171e0fe757 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginProperties.java @@ -0,0 +1,250 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.OriginProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginResourceState; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; +import java.io.IOException; + +/** + * The JSON object that contains the properties of the origin. + */ +@Fluent +public final class OriginProperties extends OriginUpdatePropertiesParameters { + /* + * Resource status of the origin. + */ + private OriginResourceState resourceState; + + /* + * Provisioning status of the origin. + */ + private OriginProvisioningState provisioningState; + + /* + * The approval status for the connection to the Private Link + */ + private PrivateEndpointStatus privateEndpointStatus; + + /** + * Creates an instance of OriginProperties class. + */ + public OriginProperties() { + } + + /** + * Get the resourceState property: Resource status of the origin. + * + * @return the resourceState value. + */ + public OriginResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning status of the origin. + * + * @return the provisioningState value. + */ + public OriginProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + public PrivateEndpointStatus privateEndpointStatus() { + return this.privateEndpointStatus; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withHostname(String hostname) { + super.withHostname(hostname); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withHttpPort(Integer httpPort) { + super.withHttpPort(httpPort); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withHttpsPort(Integer httpsPort) { + super.withHttpsPort(httpsPort); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withOriginHostHeader(String originHostHeader) { + super.withOriginHostHeader(originHostHeader); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withWeight(Integer weight) { + super.withWeight(weight); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withEnabled(Boolean enabled) { + super.withEnabled(enabled); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withPrivateLinkAlias(String privateLinkAlias) { + super.withPrivateLinkAlias(privateLinkAlias); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withPrivateLinkResourceId(String privateLinkResourceId) { + super.withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withPrivateLinkLocation(String privateLinkLocation) { + super.withPrivateLinkLocation(privateLinkLocation); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OriginProperties withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + super.withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", hostname()); + jsonWriter.writeNumberField("httpPort", httpPort()); + jsonWriter.writeNumberField("httpsPort", httpsPort()); + jsonWriter.writeStringField("originHostHeader", originHostHeader()); + jsonWriter.writeNumberField("priority", priority()); + jsonWriter.writeNumberField("weight", weight()); + jsonWriter.writeBooleanField("enabled", enabled()); + jsonWriter.writeStringField("privateLinkAlias", privateLinkAlias()); + jsonWriter.writeStringField("privateLinkResourceId", privateLinkResourceId()); + jsonWriter.writeStringField("privateLinkLocation", privateLinkLocation()); + jsonWriter.writeStringField("privateLinkApprovalMessage", privateLinkApprovalMessage()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginProperties. + */ + public static OriginProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginProperties deserializedOriginProperties = new OriginProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedOriginProperties.withHostname(reader.getString()); + } else if ("httpPort".equals(fieldName)) { + deserializedOriginProperties.withHttpPort(reader.getNullable(JsonReader::getInt)); + } else if ("httpsPort".equals(fieldName)) { + deserializedOriginProperties.withHttpsPort(reader.getNullable(JsonReader::getInt)); + } else if ("originHostHeader".equals(fieldName)) { + deserializedOriginProperties.withOriginHostHeader(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedOriginProperties.withPriority(reader.getNullable(JsonReader::getInt)); + } else if ("weight".equals(fieldName)) { + deserializedOriginProperties.withWeight(reader.getNullable(JsonReader::getInt)); + } else if ("enabled".equals(fieldName)) { + deserializedOriginProperties.withEnabled(reader.getNullable(JsonReader::getBoolean)); + } else if ("privateLinkAlias".equals(fieldName)) { + deserializedOriginProperties.withPrivateLinkAlias(reader.getString()); + } else if ("privateLinkResourceId".equals(fieldName)) { + deserializedOriginProperties.withPrivateLinkResourceId(reader.getString()); + } else if ("privateLinkLocation".equals(fieldName)) { + deserializedOriginProperties.withPrivateLinkLocation(reader.getString()); + } else if ("privateLinkApprovalMessage".equals(fieldName)) { + deserializedOriginProperties.withPrivateLinkApprovalMessage(reader.getString()); + } else if ("resourceState".equals(fieldName)) { + deserializedOriginProperties.resourceState = OriginResourceState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedOriginProperties.provisioningState + = OriginProvisioningState.fromString(reader.getString()); + } else if ("privateEndpointStatus".equals(fieldName)) { + deserializedOriginProperties.privateEndpointStatus + = PrivateEndpointStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginUpdatePropertiesParameters.java new file mode 100644 index 000000000000..204036b90f2c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginUpdatePropertiesParameters.java @@ -0,0 +1,399 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The JSON object that contains the properties of the origin. + */ +@Fluent +public class OriginUpdatePropertiesParameters implements JsonSerializable { + /* + * The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique + * across all origins in an endpoint. + */ + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + 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 + */ + 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 + */ + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 + */ + private Integer weight; + + /* + * Origin is enabled for load balancing or not + */ + private Boolean enabled; + + /* + * The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' + */ + private String privateLinkAlias; + + /* + * The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is + * 'Private' + */ + private String privateLinkResourceId; + + /* + * The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated + */ + private String privateLinkLocation; + + /* + * A custom message to be included in the approval request to connect to the Private Link. + */ + private String privateLinkApprovalMessage; + + /** + * Creates an instance of OriginUpdatePropertiesParameters class. + */ + public OriginUpdatePropertiesParameters() { + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled the enabled value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.privateLinkAlias; + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPrivateLinkAlias(String privateLinkAlias) { + this.privateLinkAlias = privateLinkAlias; + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.privateLinkResourceId; + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.privateLinkLocation; + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPrivateLinkLocation(String privateLinkLocation) { + this.privateLinkLocation = privateLinkLocation; + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.privateLinkApprovalMessage; + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + this.privateLinkApprovalMessage = privateLinkApprovalMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeNumberField("httpPort", this.httpPort); + jsonWriter.writeNumberField("httpsPort", this.httpsPort); + jsonWriter.writeStringField("originHostHeader", this.originHostHeader); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeNumberField("weight", this.weight); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("privateLinkAlias", this.privateLinkAlias); + jsonWriter.writeStringField("privateLinkResourceId", this.privateLinkResourceId); + jsonWriter.writeStringField("privateLinkLocation", this.privateLinkLocation); + jsonWriter.writeStringField("privateLinkApprovalMessage", this.privateLinkApprovalMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginUpdatePropertiesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginUpdatePropertiesParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginUpdatePropertiesParameters. + */ + public static OriginUpdatePropertiesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginUpdatePropertiesParameters deserializedOriginUpdatePropertiesParameters + = new OriginUpdatePropertiesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.hostname = reader.getString(); + } else if ("httpPort".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.httpPort = reader.getNullable(JsonReader::getInt); + } else if ("httpsPort".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.httpsPort = reader.getNullable(JsonReader::getInt); + } else if ("originHostHeader".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.originHostHeader = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.priority = reader.getNullable(JsonReader::getInt); + } else if ("weight".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.weight = reader.getNullable(JsonReader::getInt); + } else if ("enabled".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("privateLinkAlias".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.privateLinkAlias = reader.getString(); + } else if ("privateLinkResourceId".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.privateLinkResourceId = reader.getString(); + } else if ("privateLinkLocation".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.privateLinkLocation = reader.getString(); + } else if ("privateLinkApprovalMessage".equals(fieldName)) { + deserializedOriginUpdatePropertiesParameters.privateLinkApprovalMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginUpdatePropertiesParameters; + }); + } +} 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 000000000000..2cc3fc0e41d4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileInner.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cdn.generated.models.ProfileLogScrubbing; +import com.azure.resourcemanager.cdn.generated.models.ProfileProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.ProfileResourceState; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import java.io.IOException; +import java.util.Map; + +/** + * A profile is a logical grouping of endpoints that share the same settings. + */ +@Fluent +public final class ProfileInner extends Resource { + /* + * The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature list and rate) of the + * profile. + */ + private Sku sku; + + /* + * Kind of the profile. Used by portal to differentiate traditional CDN profile and new AFD profile. + */ + private String kind; + + /* + * Managed service identity (system assigned and/or user assigned identities). + */ + private ManagedServiceIdentity identity; + + /* + * The JSON object that contains the properties required to create a profile. + */ + private ProfileProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ProfileInner class. + */ + public ProfileInner() { + } + + /** + * Get the sku property: The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature + * list and rate) of the profile. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature + * list and rate) of the profile. + * + * @param sku the sku value to set. + * @return the ProfileInner object itself. + */ + public ProfileInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the kind property: Kind of the profile. Used by portal to differentiate traditional CDN profile and new AFD + * profile. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the ProfileInner object itself. + */ + public ProfileInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The JSON object that contains the properties required to create a profile. + * + * @return the innerProperties value. + */ + private ProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the resourceState property: Resource status of the profile. + * + * @return the resourceState value. + */ + public ProfileResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the provisioningState property: Provisioning status of the profile. + * + * @return the provisioningState value. + */ + public ProfileProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the extendedProperties property: Key-Value pair representing additional properties for profiles. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); + } + + /** + * Get the frontDoorId property: The Id of the frontdoor. + * + * @return the frontDoorId value. + */ + public String frontDoorId() { + return this.innerProperties() == null ? null : this.innerProperties().frontDoorId(); + } + + /** + * Get the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + public Integer originResponseTimeoutSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().originResponseTimeoutSeconds(); + } + + /** + * Set the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @param originResponseTimeoutSeconds the originResponseTimeoutSeconds value to set. + * @return the ProfileInner object itself. + */ + public ProfileInner withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + if (this.innerProperties() == null) { + this.innerProperties = new ProfileProperties(); + } + this.innerProperties().withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } + + /** + * Get the logScrubbing property: Defines rules that scrub sensitive fields in the Azure Front Door profile logs. + * + * @return the logScrubbing value. + */ + public ProfileLogScrubbing logScrubbing() { + return this.innerProperties() == null ? null : this.innerProperties().logScrubbing(); + } + + /** + * Set the logScrubbing property: Defines rules that scrub sensitive fields in the Azure Front Door profile logs. + * + * @param logScrubbing the logScrubbing value to set. + * @return the ProfileInner object itself. + */ + public ProfileInner withLogScrubbing(ProfileLogScrubbing logScrubbing) { + if (this.innerProperties() == null) { + this.innerProperties = new ProfileProperties(); + } + this.innerProperties().withLogScrubbing(logScrubbing); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sku in model ProfileInner")); + } else { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProfileInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProfileInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProfileInner. + */ + public static ProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProfileInner deserializedProfileInner = new ProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProfileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProfileInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedProfileInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedProfileInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedProfileInner.sku = Sku.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedProfileInner.kind = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedProfileInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedProfileInner.innerProperties = ProfileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProfileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProfileInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileProperties.java new file mode 100644 index 000000000000..a7442cbd473e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ProfileLogScrubbing; +import com.azure.resourcemanager.cdn.generated.models.ProfileProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.ProfileResourceState; +import java.io.IOException; +import java.util.Map; + +/** + * The JSON object that contains the properties required to create a profile. + */ +@Fluent +public final class ProfileProperties implements JsonSerializable { + /* + * Resource status of the profile. + */ + private ProfileResourceState resourceState; + + /* + * Provisioning status of the profile. + */ + private ProfileProvisioningState provisioningState; + + /* + * Key-Value pair representing additional properties for profiles. + */ + private Map extendedProperties; + + /* + * The Id of the frontdoor. + */ + private String frontDoorId; + + /* + * Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and + * returns. + */ + private Integer originResponseTimeoutSeconds; + + /* + * Defines rules that scrub sensitive fields in the Azure Front Door profile logs. + */ + private ProfileLogScrubbing logScrubbing; + + /** + * Creates an instance of ProfileProperties class. + */ + public ProfileProperties() { + } + + /** + * Get the resourceState property: Resource status of the profile. + * + * @return the resourceState value. + */ + public ProfileResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning status of the profile. + * + * @return the provisioningState value. + */ + public ProfileProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the extendedProperties property: Key-Value pair representing additional properties for profiles. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Get the frontDoorId property: The Id of the frontdoor. + * + * @return the frontDoorId value. + */ + public String frontDoorId() { + return this.frontDoorId; + } + + /** + * Get the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + public Integer originResponseTimeoutSeconds() { + return this.originResponseTimeoutSeconds; + } + + /** + * Set the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @param originResponseTimeoutSeconds the originResponseTimeoutSeconds value to set. + * @return the ProfileProperties object itself. + */ + public ProfileProperties withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + this.originResponseTimeoutSeconds = originResponseTimeoutSeconds; + return this; + } + + /** + * Get the logScrubbing property: Defines rules that scrub sensitive fields in the Azure Front Door profile logs. + * + * @return the logScrubbing value. + */ + public ProfileLogScrubbing logScrubbing() { + return this.logScrubbing; + } + + /** + * Set the logScrubbing property: Defines rules that scrub sensitive fields in the Azure Front Door profile logs. + * + * @param logScrubbing the logScrubbing value to set. + * @return the ProfileProperties object itself. + */ + public ProfileProperties withLogScrubbing(ProfileLogScrubbing logScrubbing) { + this.logScrubbing = logScrubbing; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logScrubbing() != null) { + logScrubbing().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("originResponseTimeoutSeconds", this.originResponseTimeoutSeconds); + jsonWriter.writeJsonField("logScrubbing", this.logScrubbing); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProfileProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProfileProperties. + */ + public static ProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProfileProperties deserializedProfileProperties = new ProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceState".equals(fieldName)) { + deserializedProfileProperties.resourceState = ProfileResourceState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedProfileProperties.provisioningState + = ProfileProvisioningState.fromString(reader.getString()); + } else if ("extendedProperties".equals(fieldName)) { + Map extendedProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedProfileProperties.extendedProperties = extendedProperties; + } else if ("frontDoorId".equals(fieldName)) { + deserializedProfileProperties.frontDoorId = reader.getString(); + } else if ("originResponseTimeoutSeconds".equals(fieldName)) { + deserializedProfileProperties.originResponseTimeoutSeconds = reader.getNullable(JsonReader::getInt); + } else if ("logScrubbing".equals(fieldName)) { + deserializedProfileProperties.logScrubbing = ProfileLogScrubbing.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProfileProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfilePropertiesUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfilePropertiesUpdateParameters.java new file mode 100644 index 000000000000..778ea1f9789e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfilePropertiesUpdateParameters.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ProfileLogScrubbing; +import java.io.IOException; + +/** + * The JSON object containing profile update parameters. + */ +@Fluent +public final class ProfilePropertiesUpdateParameters implements JsonSerializable { + /* + * Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and + * returns. + */ + private Integer originResponseTimeoutSeconds; + + /* + * Defines rules to scrub sensitive fields in logs + */ + private ProfileLogScrubbing logScrubbing; + + /** + * Creates an instance of ProfilePropertiesUpdateParameters class. + */ + public ProfilePropertiesUpdateParameters() { + } + + /** + * Get the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + public Integer originResponseTimeoutSeconds() { + return this.originResponseTimeoutSeconds; + } + + /** + * Set the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @param originResponseTimeoutSeconds the originResponseTimeoutSeconds value to set. + * @return the ProfilePropertiesUpdateParameters object itself. + */ + public ProfilePropertiesUpdateParameters withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + this.originResponseTimeoutSeconds = originResponseTimeoutSeconds; + return this; + } + + /** + * Get the logScrubbing property: Defines rules to scrub sensitive fields in logs. + * + * @return the logScrubbing value. + */ + public ProfileLogScrubbing logScrubbing() { + return this.logScrubbing; + } + + /** + * Set the logScrubbing property: Defines rules to scrub sensitive fields in logs. + * + * @param logScrubbing the logScrubbing value to set. + * @return the ProfilePropertiesUpdateParameters object itself. + */ + public ProfilePropertiesUpdateParameters withLogScrubbing(ProfileLogScrubbing logScrubbing) { + this.logScrubbing = logScrubbing; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logScrubbing() != null) { + logScrubbing().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("originResponseTimeoutSeconds", this.originResponseTimeoutSeconds); + jsonWriter.writeJsonField("logScrubbing", this.logScrubbing); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProfilePropertiesUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProfilePropertiesUpdateParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProfilePropertiesUpdateParameters. + */ + public static ProfilePropertiesUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProfilePropertiesUpdateParameters deserializedProfilePropertiesUpdateParameters + = new ProfilePropertiesUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("originResponseTimeoutSeconds".equals(fieldName)) { + deserializedProfilePropertiesUpdateParameters.originResponseTimeoutSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("logScrubbing".equals(fieldName)) { + deserializedProfilePropertiesUpdateParameters.logScrubbing = ProfileLogScrubbing.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProfilePropertiesUpdateParameters; + }); + } +} 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 000000000000..162cc783f4b2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RankingsResponseInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.RankingsResponseTablesItem; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Rankings Response. + */ +@Fluent +public final class RankingsResponseInner implements JsonSerializable { + /* + * The dateTimeBegin property. + */ + private OffsetDateTime dateTimeBegin; + + /* + * The dateTimeEnd property. + */ + private OffsetDateTime dateTimeEnd; + + /* + * The tables property. + */ + private List tables; + + /** + * Creates an instance of RankingsResponseInner class. + */ + public RankingsResponseInner() { + } + + /** + * Get the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + public OffsetDateTime dateTimeBegin() { + return this.dateTimeBegin; + } + + /** + * Set the dateTimeBegin property: The dateTimeBegin property. + * + * @param dateTimeBegin the dateTimeBegin value to set. + * @return the RankingsResponseInner object itself. + */ + public RankingsResponseInner withDateTimeBegin(OffsetDateTime dateTimeBegin) { + this.dateTimeBegin = dateTimeBegin; + return this; + } + + /** + * Get the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + public OffsetDateTime dateTimeEnd() { + return this.dateTimeEnd; + } + + /** + * Set the dateTimeEnd property: The dateTimeEnd property. + * + * @param dateTimeEnd the dateTimeEnd value to set. + * @return the RankingsResponseInner object itself. + */ + public RankingsResponseInner withDateTimeEnd(OffsetDateTime dateTimeEnd) { + this.dateTimeEnd = dateTimeEnd; + return this; + } + + /** + * Get the tables property: The tables property. + * + * @return the tables value. + */ + public List tables() { + return this.tables; + } + + /** + * Set the tables property: The tables property. + * + * @param tables the tables value to set. + * @return the RankingsResponseInner object itself. + */ + public RankingsResponseInner withTables(List tables) { + this.tables = tables; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tables() != null) { + tables().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dateTimeBegin", + this.dateTimeBegin == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTimeBegin)); + jsonWriter.writeStringField("dateTimeEnd", + this.dateTimeEnd == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTimeEnd)); + jsonWriter.writeArrayField("tables", this.tables, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RankingsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RankingsResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RankingsResponseInner. + */ + public static RankingsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RankingsResponseInner deserializedRankingsResponseInner = new RankingsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dateTimeBegin".equals(fieldName)) { + deserializedRankingsResponseInner.dateTimeBegin = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dateTimeEnd".equals(fieldName)) { + deserializedRankingsResponseInner.dateTimeEnd = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("tables".equals(fieldName)) { + List tables + = reader.readArray(reader1 -> RankingsResponseTablesItem.fromJson(reader1)); + deserializedRankingsResponseInner.tables = tables; + } else { + reader.skipChildren(); + } + } + + return deserializedRankingsResponseInner; + }); + } +} 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 000000000000..372dd343d0d9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourceUsageInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageUnit; +import java.io.IOException; + +/** + * Output of check resource usage API. + */ +@Immutable +public final class ResourceUsageInner implements JsonSerializable { + /* + * Resource type for which the usage is provided. + */ + private String resourceType; + + /* + * Unit of the usage. e.g. count. + */ + private ResourceUsageUnit unit; + + /* + * Actual value of usage on the specified resource type. + */ + private Integer currentValue; + + /* + * Quota of the specified resource type. + */ + private Integer limit; + + /** + * Creates an instance of ResourceUsageInner class. + */ + public ResourceUsageInner() { + } + + /** + * Get the resourceType property: Resource type for which the usage is provided. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the unit property: Unit of the usage. e.g. count. + * + * @return the unit value. + */ + public ResourceUsageUnit unit() { + return this.unit; + } + + /** + * Get the currentValue property: Actual value of usage on the specified resource type. + * + * @return the currentValue value. + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the limit property: Quota of the specified resource type. + * + * @return the limit value. + */ + public Integer limit() { + return this.limit; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceUsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceUsageInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceUsageInner. + */ + public static ResourceUsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceUsageInner deserializedResourceUsageInner = new ResourceUsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedResourceUsageInner.resourceType = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedResourceUsageInner.unit = ResourceUsageUnit.fromString(reader.getString()); + } else if ("currentValue".equals(fieldName)) { + deserializedResourceUsageInner.currentValue = reader.getNullable(JsonReader::getInt); + } else if ("limit".equals(fieldName)) { + deserializedResourceUsageInner.limit = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceUsageInner; + }); + } +} 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 000000000000..753f1b1314cb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourcesResponseInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseCustomDomainsItem; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseEndpointsItem; +import java.io.IOException; +import java.util.List; + +/** + * Resources Response. + */ +@Fluent +public final class ResourcesResponseInner implements JsonSerializable { + /* + * The endpoints property. + */ + private List endpoints; + + /* + * The customDomains property. + */ + private List customDomains; + + /** + * Creates an instance of ResourcesResponseInner class. + */ + public ResourcesResponseInner() { + } + + /** + * Get the endpoints property: The endpoints property. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The endpoints property. + * + * @param endpoints the endpoints value to set. + * @return the ResourcesResponseInner object itself. + */ + public ResourcesResponseInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the customDomains property: The customDomains property. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.customDomains; + } + + /** + * Set the customDomains property: The customDomains property. + * + * @param customDomains the customDomains value to set. + * @return the ResourcesResponseInner object itself. + */ + public ResourcesResponseInner withCustomDomains(List customDomains) { + this.customDomains = customDomains; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (customDomains() != null) { + customDomains().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("customDomains", this.customDomains, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourcesResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourcesResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourcesResponseInner. + */ + public static ResourcesResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourcesResponseInner deserializedResourcesResponseInner = new ResourcesResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoints".equals(fieldName)) { + List endpoints + = reader.readArray(reader1 -> ResourcesResponseEndpointsItem.fromJson(reader1)); + deserializedResourcesResponseInner.endpoints = endpoints; + } else if ("customDomains".equals(fieldName)) { + List customDomains + = reader.readArray(reader1 -> ResourcesResponseCustomDomainsItem.fromJson(reader1)); + deserializedResourcesResponseInner.customDomains = customDomains; + } else { + reader.skipChildren(); + } + } + + return deserializedResourcesResponseInner; + }); + } +} 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 000000000000..a0c80aa73e74 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteInner.java @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.io.IOException; +import java.util.List; + +/** + * Friendly Routes name mapping to the any Routes or secret related information. + */ +@Fluent +public final class RouteInner extends ProxyResource { + /* + * The JSON object that contains the properties of the Routes to create. + */ + private RouteProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RouteInner class. + */ + public RouteInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the Routes to create. + * + * @return the innerProperties value. + */ + private RouteProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the endpointName property: The name of the endpoint which holds the route. + * + * @return the endpointName value. + */ + public String endpointName() { + return this.innerProperties() == null ? null : this.innerProperties().endpointName(); + } + + /** + * Get the customDomains property: Domains referenced by this endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.innerProperties() == null ? null : this.innerProperties().customDomains(); + } + + /** + * Set the customDomains property: Domains referenced by this endpoint. + * + * @param customDomains the customDomains value to set. + * @return the RouteInner object itself. + */ + public RouteInner withCustomDomains(List customDomains) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withCustomDomains(customDomains); + return this; + } + + /** + * Get the originGroup property: A reference to the origin group. + * + * @return the originGroup value. + */ + public ResourceReference originGroup() { + return this.innerProperties() == null ? null : this.innerProperties().originGroup(); + } + + /** + * Set the originGroup property: A reference to the origin group. + * + * @param originGroup the originGroup value to set. + * @return the RouteInner object itself. + */ + public RouteInner withOriginGroup(ResourceReference originGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withOriginGroup(originGroup); + return this; + } + + /** + * Get the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.innerProperties() == null ? null : this.innerProperties().originPath(); + } + + /** + * Set the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the RouteInner object itself. + */ + public RouteInner withOriginPath(String originPath) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withOriginPath(originPath); + return this; + } + + /** + * Get the ruleSets property: rule sets referenced by this endpoint. + * + * @return the ruleSets value. + */ + public List ruleSets() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSets(); + } + + /** + * Set the ruleSets property: rule sets referenced by this endpoint. + * + * @param ruleSets the ruleSets value to set. + * @return the RouteInner object itself. + */ + public RouteInner withRuleSets(List ruleSets) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withRuleSets(ruleSets); + return this; + } + + /** + * Get the supportedProtocols property: List of supported protocols for this route. + * + * @return the supportedProtocols value. + */ + public List supportedProtocols() { + return this.innerProperties() == null ? null : this.innerProperties().supportedProtocols(); + } + + /** + * Set the supportedProtocols property: List of supported protocols for this route. + * + * @param supportedProtocols the supportedProtocols value to set. + * @return the RouteInner object itself. + */ + public RouteInner withSupportedProtocols(List supportedProtocols) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withSupportedProtocols(supportedProtocols); + return this; + } + + /** + * Get the patternsToMatch property: The route patterns of the rule. + * + * @return the patternsToMatch value. + */ + public List patternsToMatch() { + return this.innerProperties() == null ? null : this.innerProperties().patternsToMatch(); + } + + /** + * Set the patternsToMatch property: The route patterns of the rule. + * + * @param patternsToMatch the patternsToMatch value to set. + * @return the RouteInner object itself. + */ + public RouteInner withPatternsToMatch(List patternsToMatch) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withPatternsToMatch(patternsToMatch); + return this; + } + + /** + * Get the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + public AfdRouteCacheConfiguration cacheConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().cacheConfiguration(); + } + + /** + * Set the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @param cacheConfiguration the cacheConfiguration value to set. + * @return the RouteInner object itself. + */ + public RouteInner withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withCacheConfiguration(cacheConfiguration); + return this; + } + + /** + * Get the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + public ForwardingProtocol forwardingProtocol() { + return this.innerProperties() == null ? null : this.innerProperties().forwardingProtocol(); + } + + /** + * Set the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @param forwardingProtocol the forwardingProtocol value to set. + * @return the RouteInner object itself. + */ + public RouteInner withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withForwardingProtocol(forwardingProtocol); + return this; + } + + /** + * Get the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @return the linkToDefaultDomain value. + */ + public LinkToDefaultDomain linkToDefaultDomain() { + return this.innerProperties() == null ? null : this.innerProperties().linkToDefaultDomain(); + } + + /** + * Set the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @param linkToDefaultDomain the linkToDefaultDomain value to set. + * @return the RouteInner object itself. + */ + public RouteInner withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } + + /** + * Get the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @return the httpsRedirect value. + */ + public HttpsRedirect httpsRedirect() { + return this.innerProperties() == null ? null : this.innerProperties().httpsRedirect(); + } + + /** + * Set the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @param httpsRedirect the httpsRedirect value to set. + * @return the RouteInner object itself. + */ + public RouteInner withHttpsRedirect(HttpsRedirect httpsRedirect) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withHttpsRedirect(httpsRedirect); + return this; + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the RouteInner object itself. + */ + public RouteInner withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RouteInner. + */ + public static RouteInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteInner deserializedRouteInner = new RouteInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRouteInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRouteInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRouteInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRouteInner.innerProperties = RouteProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRouteInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteProperties.java new file mode 100644 index 000000000000..bd27cf4a4b5f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteProperties.java @@ -0,0 +1,281 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.io.IOException; +import java.util.List; + +/** + * The JSON object that contains the properties of the Routes to create. + */ +@Fluent +public final class RouteProperties extends RouteUpdatePropertiesParameters { + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /* + * The name of the endpoint which holds the route. + */ + private String endpointName; + + /** + * Creates an instance of RouteProperties class. + */ + public RouteProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the endpointName property: The name of the endpoint which holds the route. + * + * @return the endpointName value. + */ + @Override + public String endpointName() { + return this.endpointName; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withCustomDomains(List customDomains) { + super.withCustomDomains(customDomains); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withOriginGroup(ResourceReference originGroup) { + super.withOriginGroup(originGroup); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withOriginPath(String originPath) { + super.withOriginPath(originPath); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withRuleSets(List ruleSets) { + super.withRuleSets(ruleSets); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withSupportedProtocols(List supportedProtocols) { + super.withSupportedProtocols(supportedProtocols); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withPatternsToMatch(List patternsToMatch) { + super.withPatternsToMatch(patternsToMatch); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + super.withCacheConfiguration(cacheConfiguration); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + super.withForwardingProtocol(forwardingProtocol); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + super.withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withHttpsRedirect(HttpsRedirect httpsRedirect) { + super.withHttpsRedirect(httpsRedirect); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteProperties withEnabledState(EnabledState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (customDomains() != null) { + customDomains().forEach(e -> e.validate()); + } + if (originGroup() != null) { + originGroup().validate(); + } + if (ruleSets() != null) { + ruleSets().forEach(e -> e.validate()); + } + if (cacheConfiguration() != null) { + cacheConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("customDomains", customDomains(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("originGroup", originGroup()); + jsonWriter.writeStringField("originPath", originPath()); + jsonWriter.writeArrayField("ruleSets", ruleSets(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("supportedProtocols", supportedProtocols(), + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("patternsToMatch", patternsToMatch(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("cacheConfiguration", cacheConfiguration()); + jsonWriter.writeStringField("forwardingProtocol", + forwardingProtocol() == null ? null : forwardingProtocol().toString()); + jsonWriter.writeStringField("linkToDefaultDomain", + linkToDefaultDomain() == null ? null : linkToDefaultDomain().toString()); + jsonWriter.writeStringField("httpsRedirect", httpsRedirect() == null ? null : httpsRedirect().toString()); + jsonWriter.writeStringField("enabledState", enabledState() == null ? null : enabledState().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteProperties. + */ + public static RouteProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteProperties deserializedRouteProperties = new RouteProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpointName".equals(fieldName)) { + deserializedRouteProperties.endpointName = reader.getString(); + } else if ("customDomains".equals(fieldName)) { + List customDomains + = reader.readArray(reader1 -> ActivatedResourceReference.fromJson(reader1)); + deserializedRouteProperties.withCustomDomains(customDomains); + } else if ("originGroup".equals(fieldName)) { + deserializedRouteProperties.withOriginGroup(ResourceReference.fromJson(reader)); + } else if ("originPath".equals(fieldName)) { + deserializedRouteProperties.withOriginPath(reader.getString()); + } else if ("ruleSets".equals(fieldName)) { + List ruleSets = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); + deserializedRouteProperties.withRuleSets(ruleSets); + } else if ("supportedProtocols".equals(fieldName)) { + List supportedProtocols + = reader.readArray(reader1 -> AfdEndpointProtocols.fromString(reader1.getString())); + deserializedRouteProperties.withSupportedProtocols(supportedProtocols); + } else if ("patternsToMatch".equals(fieldName)) { + List patternsToMatch = reader.readArray(reader1 -> reader1.getString()); + deserializedRouteProperties.withPatternsToMatch(patternsToMatch); + } else if ("cacheConfiguration".equals(fieldName)) { + deserializedRouteProperties.withCacheConfiguration(AfdRouteCacheConfiguration.fromJson(reader)); + } else if ("forwardingProtocol".equals(fieldName)) { + deserializedRouteProperties + .withForwardingProtocol(ForwardingProtocol.fromString(reader.getString())); + } else if ("linkToDefaultDomain".equals(fieldName)) { + deserializedRouteProperties + .withLinkToDefaultDomain(LinkToDefaultDomain.fromString(reader.getString())); + } else if ("httpsRedirect".equals(fieldName)) { + deserializedRouteProperties.withHttpsRedirect(HttpsRedirect.fromString(reader.getString())); + } else if ("enabledState".equals(fieldName)) { + deserializedRouteProperties.withEnabledState(EnabledState.fromString(reader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedRouteProperties.provisioningState = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedRouteProperties.deploymentStatus = DeploymentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteUpdatePropertiesParameters.java new file mode 100644 index 000000000000..2c63983d289b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteUpdatePropertiesParameters.java @@ -0,0 +1,445 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.io.IOException; +import java.util.List; + +/** + * The JSON object that contains the properties of the domain to create. + */ +@Fluent +public class RouteUpdatePropertiesParameters implements JsonSerializable { + /* + * The name of the endpoint which holds the route. + */ + private String endpointName; + + /* + * Domains referenced by this endpoint. + */ + private List customDomains; + + /* + * A reference to the origin group. + */ + private ResourceReference originGroup; + + /* + * A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + */ + private String originPath; + + /* + * rule sets referenced by this endpoint. + */ + private List ruleSets; + + /* + * List of supported protocols for this route. + */ + private List supportedProtocols; + + /* + * The route patterns of the rule. + */ + private List patternsToMatch; + + /* + * The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object. + */ + private AfdRouteCacheConfiguration cacheConfiguration; + + /* + * Protocol this rule will use when forwarding traffic to backends. + */ + private ForwardingProtocol forwardingProtocol; + + /* + * whether this route will be linked to the default endpoint domain. + */ + 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. + */ + private HttpsRedirect httpsRedirect; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled' + */ + private EnabledState enabledState; + + /** + * Creates an instance of RouteUpdatePropertiesParameters class. + */ + public RouteUpdatePropertiesParameters() { + } + + /** + * Get the endpointName property: The name of the endpoint which holds the route. + * + * @return the endpointName value. + */ + public String endpointName() { + return this.endpointName; + } + + /** + * Set the endpointName property: The name of the endpoint which holds the route. + * + * @param endpointName the endpointName value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + RouteUpdatePropertiesParameters withEndpointName(String endpointName) { + this.endpointName = endpointName; + return this; + } + + /** + * Get the customDomains property: Domains referenced by this endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.customDomains; + } + + /** + * Set the customDomains property: Domains referenced by this endpoint. + * + * @param customDomains the customDomains value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withCustomDomains(List customDomains) { + this.customDomains = customDomains; + return this; + } + + /** + * Get the originGroup property: A reference to the origin group. + * + * @return the originGroup value. + */ + public ResourceReference originGroup() { + return this.originGroup; + } + + /** + * Set the originGroup property: A reference to the origin group. + * + * @param originGroup the originGroup value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withOriginGroup(ResourceReference originGroup) { + this.originGroup = originGroup; + return this; + } + + /** + * Get the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.originPath; + } + + /** + * Set the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withOriginPath(String originPath) { + this.originPath = originPath; + return this; + } + + /** + * Get the ruleSets property: rule sets referenced by this endpoint. + * + * @return the ruleSets value. + */ + public List ruleSets() { + return this.ruleSets; + } + + /** + * Set the ruleSets property: rule sets referenced by this endpoint. + * + * @param ruleSets the ruleSets value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withRuleSets(List ruleSets) { + this.ruleSets = ruleSets; + return this; + } + + /** + * Get the supportedProtocols property: List of supported protocols for this route. + * + * @return the supportedProtocols value. + */ + public List supportedProtocols() { + return this.supportedProtocols; + } + + /** + * Set the supportedProtocols property: List of supported protocols for this route. + * + * @param supportedProtocols the supportedProtocols value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withSupportedProtocols(List supportedProtocols) { + this.supportedProtocols = supportedProtocols; + return this; + } + + /** + * Get the patternsToMatch property: The route patterns of the rule. + * + * @return the patternsToMatch value. + */ + public List patternsToMatch() { + return this.patternsToMatch; + } + + /** + * Set the patternsToMatch property: The route patterns of the rule. + * + * @param patternsToMatch the patternsToMatch value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withPatternsToMatch(List patternsToMatch) { + this.patternsToMatch = patternsToMatch; + return this; + } + + /** + * Get the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + public AfdRouteCacheConfiguration cacheConfiguration() { + return this.cacheConfiguration; + } + + /** + * Set the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @param cacheConfiguration the cacheConfiguration value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + this.cacheConfiguration = cacheConfiguration; + return this; + } + + /** + * Get the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + public ForwardingProtocol forwardingProtocol() { + return this.forwardingProtocol; + } + + /** + * Set the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @param forwardingProtocol the forwardingProtocol value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + this.forwardingProtocol = forwardingProtocol; + return this; + } + + /** + * Get the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @return the linkToDefaultDomain value. + */ + public LinkToDefaultDomain linkToDefaultDomain() { + return this.linkToDefaultDomain; + } + + /** + * Set the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @param linkToDefaultDomain the linkToDefaultDomain value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + this.linkToDefaultDomain = linkToDefaultDomain; + return this; + } + + /** + * Get the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @return the httpsRedirect value. + */ + public HttpsRedirect httpsRedirect() { + return this.httpsRedirect; + } + + /** + * Set the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @param httpsRedirect the httpsRedirect value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withHttpsRedirect(HttpsRedirect httpsRedirect) { + this.httpsRedirect = httpsRedirect; + return this; + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withEnabledState(EnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customDomains() != null) { + customDomains().forEach(e -> e.validate()); + } + if (originGroup() != null) { + originGroup().validate(); + } + if (ruleSets() != null) { + ruleSets().forEach(e -> e.validate()); + } + if (cacheConfiguration() != null) { + cacheConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("customDomains", this.customDomains, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("originGroup", this.originGroup); + jsonWriter.writeStringField("originPath", this.originPath); + jsonWriter.writeArrayField("ruleSets", this.ruleSets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("supportedProtocols", this.supportedProtocols, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("patternsToMatch", this.patternsToMatch, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("cacheConfiguration", this.cacheConfiguration); + jsonWriter.writeStringField("forwardingProtocol", + this.forwardingProtocol == null ? null : this.forwardingProtocol.toString()); + jsonWriter.writeStringField("linkToDefaultDomain", + this.linkToDefaultDomain == null ? null : this.linkToDefaultDomain.toString()); + jsonWriter.writeStringField("httpsRedirect", this.httpsRedirect == null ? null : this.httpsRedirect.toString()); + jsonWriter.writeStringField("enabledState", this.enabledState == null ? null : this.enabledState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteUpdatePropertiesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteUpdatePropertiesParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteUpdatePropertiesParameters. + */ + public static RouteUpdatePropertiesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteUpdatePropertiesParameters deserializedRouteUpdatePropertiesParameters + = new RouteUpdatePropertiesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpointName".equals(fieldName)) { + deserializedRouteUpdatePropertiesParameters.endpointName = reader.getString(); + } else if ("customDomains".equals(fieldName)) { + List customDomains + = reader.readArray(reader1 -> ActivatedResourceReference.fromJson(reader1)); + deserializedRouteUpdatePropertiesParameters.customDomains = customDomains; + } else if ("originGroup".equals(fieldName)) { + deserializedRouteUpdatePropertiesParameters.originGroup = ResourceReference.fromJson(reader); + } else if ("originPath".equals(fieldName)) { + deserializedRouteUpdatePropertiesParameters.originPath = reader.getString(); + } else if ("ruleSets".equals(fieldName)) { + List ruleSets = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); + deserializedRouteUpdatePropertiesParameters.ruleSets = ruleSets; + } else if ("supportedProtocols".equals(fieldName)) { + List supportedProtocols + = reader.readArray(reader1 -> AfdEndpointProtocols.fromString(reader1.getString())); + deserializedRouteUpdatePropertiesParameters.supportedProtocols = supportedProtocols; + } else if ("patternsToMatch".equals(fieldName)) { + List patternsToMatch = reader.readArray(reader1 -> reader1.getString()); + deserializedRouteUpdatePropertiesParameters.patternsToMatch = patternsToMatch; + } else if ("cacheConfiguration".equals(fieldName)) { + deserializedRouteUpdatePropertiesParameters.cacheConfiguration + = AfdRouteCacheConfiguration.fromJson(reader); + } else if ("forwardingProtocol".equals(fieldName)) { + deserializedRouteUpdatePropertiesParameters.forwardingProtocol + = ForwardingProtocol.fromString(reader.getString()); + } else if ("linkToDefaultDomain".equals(fieldName)) { + deserializedRouteUpdatePropertiesParameters.linkToDefaultDomain + = LinkToDefaultDomain.fromString(reader.getString()); + } else if ("httpsRedirect".equals(fieldName)) { + deserializedRouteUpdatePropertiesParameters.httpsRedirect + = HttpsRedirect.fromString(reader.getString()); + } else if ("enabledState".equals(fieldName)) { + deserializedRouteUpdatePropertiesParameters.enabledState + = EnabledState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteUpdatePropertiesParameters; + }); + } +} 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 000000000000..9378b8e6a4dd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleInner.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Friendly Rules name mapping to the any Rules or secret related information. + */ +@Fluent +public final class RuleInner extends ProxyResource { + /* + * The JSON object that contains the properties of the Rules to create. + */ + private RuleProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RuleInner class. + */ + public RuleInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the Rules to create. + * + * @return the innerProperties value. + */ + private RuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the ruleSetName property: The name of the rule set containing the rule. + * + * @return the ruleSetName value. + */ + public String ruleSetName() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSetName(); + } + + /** + * Get the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value. + */ + public Integer order() { + return this.innerProperties() == null ? null : this.innerProperties().order(); + } + + /** + * Set the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @param order the order value to set. + * @return the RuleInner object itself. + */ + public RuleInner withOrder(Integer order) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleProperties(); + } + this.innerProperties().withOrder(order); + return this; + } + + /** + * Get the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value. + */ + public List conditions() { + return this.innerProperties() == null ? null : this.innerProperties().conditions(); + } + + /** + * Set the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @param conditions the conditions value to set. + * @return the RuleInner object itself. + */ + public RuleInner withConditions(List conditions) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleProperties(); + } + this.innerProperties().withConditions(conditions); + return this; + } + + /** + * Get the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @param actions the actions value to set. + * @return the RuleInner object itself. + */ + public RuleInner withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleProperties(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Get the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @return the matchProcessingBehavior value. + */ + public MatchProcessingBehavior matchProcessingBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().matchProcessingBehavior(); + } + + /** + * Set the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @param matchProcessingBehavior the matchProcessingBehavior value to set. + * @return the RuleInner object itself. + */ + public RuleInner withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleProperties(); + } + this.innerProperties().withMatchProcessingBehavior(matchProcessingBehavior); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RuleInner. + */ + public static RuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleInner deserializedRuleInner = new RuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRuleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRuleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRuleInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRuleInner.innerProperties = RuleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRuleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleProperties.java new file mode 100644 index 000000000000..6a57bdfebe5d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * The JSON object that contains the properties of the Rules to create. + */ +@Fluent +public final class RuleProperties extends RuleUpdatePropertiesParameters { + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /* + * The name of the rule set containing the rule. + */ + private String ruleSetName; + + /** + * Creates an instance of RuleProperties class. + */ + public RuleProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the ruleSetName property: The name of the rule set containing the rule. + * + * @return the ruleSetName value. + */ + @Override + public String ruleSetName() { + return this.ruleSetName; + } + + /** + * {@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() { + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + if (actions() != null) { + actions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("order", order()); + jsonWriter.writeArrayField("conditions", conditions(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("actions", actions(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("matchProcessingBehavior", + matchProcessingBehavior() == null ? null : matchProcessingBehavior().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleProperties. + */ + public static RuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleProperties deserializedRuleProperties = new RuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleSetName".equals(fieldName)) { + deserializedRuleProperties.ruleSetName = reader.getString(); + } else if ("order".equals(fieldName)) { + deserializedRuleProperties.withOrder(reader.getNullable(JsonReader::getInt)); + } else if ("conditions".equals(fieldName)) { + List conditions + = reader.readArray(reader1 -> DeliveryRuleCondition.fromJson(reader1)); + deserializedRuleProperties.withConditions(conditions); + } else if ("actions".equals(fieldName)) { + List actions + = reader.readArray(reader1 -> DeliveryRuleAction.fromJson(reader1)); + deserializedRuleProperties.withActions(actions); + } else if ("matchProcessingBehavior".equals(fieldName)) { + deserializedRuleProperties + .withMatchProcessingBehavior(MatchProcessingBehavior.fromString(reader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedRuleProperties.provisioningState = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedRuleProperties.deploymentStatus = DeploymentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleProperties; + }); + } +} 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 000000000000..7c2b9bda4671 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetInner.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import java.io.IOException; + +/** + * Friendly RuleSet name mapping to the any RuleSet or secret related information. + */ +@Immutable +public final class RuleSetInner extends ProxyResource { + /* + * The JSON object that contains the properties of the Rule Set to create. + */ + private RuleSetProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RuleSetInner class. + */ + public RuleSetInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the Rule Set to create. + * + * @return the innerProperties value. + */ + private RuleSetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the profileName property: The name of the profile which holds the rule set. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleSetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleSetInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RuleSetInner. + */ + public static RuleSetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleSetInner deserializedRuleSetInner = new RuleSetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRuleSetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRuleSetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRuleSetInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRuleSetInner.innerProperties = RuleSetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRuleSetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleSetInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetProperties.java new file mode 100644 index 000000000000..a4a214a9f3e1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdStateProperties; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import java.io.IOException; + +/** + * The JSON object that contains the properties of the Rule Set to create. + */ +@Immutable +public final class RuleSetProperties extends AfdStateProperties { + /* + * The name of the profile which holds the rule set. + */ + private String profileName; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /** + * Creates an instance of RuleSetProperties class. + */ + public RuleSetProperties() { + } + + /** + * Get the profileName property: The name of the profile which holds the rule set. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + @Override + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + @Override + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleSetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleSetProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleSetProperties. + */ + public static RuleSetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleSetProperties deserializedRuleSetProperties = new RuleSetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedRuleSetProperties.provisioningState + = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedRuleSetProperties.deploymentStatus = DeploymentStatus.fromString(reader.getString()); + } else if ("profileName".equals(fieldName)) { + deserializedRuleSetProperties.profileName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleSetProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleUpdatePropertiesParameters.java new file mode 100644 index 000000000000..8d8647487acc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleUpdatePropertiesParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleAction; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleCondition; +import com.azure.resourcemanager.cdn.generated.models.MatchProcessingBehavior; +import java.io.IOException; +import java.util.List; + +/** + * The JSON object that contains the properties of the rule to update. + */ +@Fluent +public class RuleUpdatePropertiesParameters implements JsonSerializable { + /* + * The name of the rule set containing the rule. + */ + private String ruleSetName; + + /* + * The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser + * order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not + * require any condition and actions listed in it will always be applied. + */ + private Integer order; + + /* + * A list of conditions that must be matched for the actions to be executed + */ + private List conditions; + + /* + * A list of actions that are executed when all the conditions of a rule are satisfied. + */ + 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. + */ + private MatchProcessingBehavior matchProcessingBehavior; + + /** + * Creates an instance of RuleUpdatePropertiesParameters class. + */ + public RuleUpdatePropertiesParameters() { + } + + /** + * Get the ruleSetName property: The name of the rule set containing the rule. + * + * @return the ruleSetName value. + */ + public String ruleSetName() { + return this.ruleSetName; + } + + /** + * Set the ruleSetName property: The name of the rule set containing the rule. + * + * @param ruleSetName the ruleSetName value to set. + * @return the RuleUpdatePropertiesParameters object itself. + */ + RuleUpdatePropertiesParameters withRuleSetName(String ruleSetName) { + this.ruleSetName = ruleSetName; + 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 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("order", this.order); + jsonWriter.writeArrayField("conditions", this.conditions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("actions", this.actions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("matchProcessingBehavior", + this.matchProcessingBehavior == null ? null : this.matchProcessingBehavior.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleUpdatePropertiesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleUpdatePropertiesParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleUpdatePropertiesParameters. + */ + public static RuleUpdatePropertiesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleUpdatePropertiesParameters deserializedRuleUpdatePropertiesParameters + = new RuleUpdatePropertiesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleSetName".equals(fieldName)) { + deserializedRuleUpdatePropertiesParameters.ruleSetName = reader.getString(); + } else if ("order".equals(fieldName)) { + deserializedRuleUpdatePropertiesParameters.order = reader.getNullable(JsonReader::getInt); + } else if ("conditions".equals(fieldName)) { + List conditions + = reader.readArray(reader1 -> DeliveryRuleCondition.fromJson(reader1)); + deserializedRuleUpdatePropertiesParameters.conditions = conditions; + } else if ("actions".equals(fieldName)) { + List actions + = reader.readArray(reader1 -> DeliveryRuleAction.fromJson(reader1)); + deserializedRuleUpdatePropertiesParameters.actions = actions; + } else if ("matchProcessingBehavior".equals(fieldName)) { + deserializedRuleUpdatePropertiesParameters.matchProcessingBehavior + = MatchProcessingBehavior.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleUpdatePropertiesParameters; + }); + } +} 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 000000000000..f26d30aad5e1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SecretParameters; +import java.io.IOException; + +/** + * Friendly Secret name mapping to the any Secret or secret related information. + */ +@Fluent +public final class SecretInner extends ProxyResource { + /* + * The JSON object that contains the properties of the Secret to create. + */ + private SecretProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SecretInner class. + */ + public SecretInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the Secret to create. + * + * @return the innerProperties value. + */ + private SecretProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the profileName property: The name of the profile which holds the secret. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the parameters property: object which contains secret parameters. + * + * @return the parameters value. + */ + public SecretParameters parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: object which contains secret parameters. + * + * @param parameters the parameters value to set. + * @return the SecretInner object itself. + */ + public SecretInner withParameters(SecretParameters parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new SecretProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecretInner. + */ + public static SecretInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretInner deserializedSecretInner = new SecretInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecretInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecretInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecretInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSecretInner.innerProperties = SecretProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSecretInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretProperties.java new file mode 100644 index 000000000000..963f534f63d9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretProperties.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdStateProperties; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SecretParameters; +import java.io.IOException; + +/** + * The JSON object that contains the properties of the Secret to create. + */ +@Fluent +public final class SecretProperties extends AfdStateProperties { + /* + * The name of the profile which holds the secret. + */ + private String profileName; + + /* + * object which contains secret parameters + */ + private SecretParameters parameters; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /** + * Creates an instance of SecretProperties class. + */ + public SecretProperties() { + } + + /** + * Get the profileName property: The name of the profile which holds the secret. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Get the parameters property: object which contains secret parameters. + * + * @return the parameters value. + */ + public SecretParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: object which contains secret parameters. + * + * @param parameters the parameters value to set. + * @return the SecretProperties object itself. + */ + public SecretProperties withParameters(SecretParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + @Override + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + @Override + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecretProperties. + */ + public static SecretProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretProperties deserializedSecretProperties = new SecretProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSecretProperties.provisioningState + = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedSecretProperties.deploymentStatus = DeploymentStatus.fromString(reader.getString()); + } else if ("profileName".equals(fieldName)) { + deserializedSecretProperties.profileName = reader.getString(); + } else if ("parameters".equals(fieldName)) { + deserializedSecretProperties.parameters = SecretParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretProperties; + }); + } +} 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 000000000000..083cd4a92637 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyPropertiesParameters; +import java.io.IOException; + +/** + * SecurityPolicy association for AzureFrontDoor profile. + */ +@Fluent +public final class SecurityPolicyInner extends ProxyResource { + /* + * The json object that contains properties required to create a security policy + */ + private SecurityPolicyProperties innerProperties; + + /* + * Read only system data + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SecurityPolicyInner class. + */ + public SecurityPolicyInner() { + } + + /** + * Get the innerProperties property: The json object that contains properties required to create a security policy. + * + * @return the innerProperties value. + */ + private SecurityPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the profileName property: The name of the profile which holds the security policy. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyPropertiesParameters parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: object which contains security policy parameters. + * + * @param parameters the parameters value to set. + * @return the SecurityPolicyInner object itself. + */ + public SecurityPolicyInner withParameters(SecurityPolicyPropertiesParameters parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityPolicyProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPolicyInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityPolicyInner. + */ + public static SecurityPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPolicyInner deserializedSecurityPolicyInner = new SecurityPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecurityPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecurityPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecurityPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSecurityPolicyInner.innerProperties = SecurityPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSecurityPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPolicyInner; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyProperties.java new file mode 100644 index 000000000000..91a556e32f31 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyProperties.java @@ -0,0 +1,153 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdStateProperties; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyPropertiesParameters; +import java.io.IOException; + +/** + * The json object that contains properties required to create a security policy. + */ +@Fluent +public final class SecurityPolicyProperties extends AfdStateProperties { + /* + * The name of the profile which holds the security policy. + */ + private String profileName; + + /* + * object which contains security policy parameters + */ + private SecurityPolicyPropertiesParameters parameters; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /** + * Creates an instance of SecurityPolicyProperties class. + */ + public SecurityPolicyProperties() { + } + + /** + * Get the profileName property: The name of the profile which holds the security policy. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyPropertiesParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: object which contains security policy parameters. + * + * @param parameters the parameters value to set. + * @return the SecurityPolicyProperties object itself. + */ + public SecurityPolicyProperties withParameters(SecurityPolicyPropertiesParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + @Override + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + @Override + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPolicyProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityPolicyProperties. + */ + public static SecurityPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPolicyProperties deserializedSecurityPolicyProperties = new SecurityPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSecurityPolicyProperties.provisioningState + = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedSecurityPolicyProperties.deploymentStatus + = DeploymentStatus.fromString(reader.getString()); + } else if ("profileName".equals(fieldName)) { + deserializedSecurityPolicyProperties.profileName = reader.getString(); + } else if ("parameters".equals(fieldName)) { + deserializedSecurityPolicyProperties.parameters + = SecurityPolicyPropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPolicyProperties; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyUpdateProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyUpdateProperties.java new file mode 100644 index 000000000000..ef26b1e23e52 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyUpdateProperties.java @@ -0,0 +1,99 @@ +// Copyright (c) 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyPropertiesParameters; +import java.io.IOException; + +/** + * The json object that contains properties required to update a security policy. + */ +@Fluent +public final class SecurityPolicyUpdateProperties implements JsonSerializable { + /* + * object which contains security policy parameters + */ + private SecurityPolicyPropertiesParameters parameters; + + /** + * Creates an instance of SecurityPolicyUpdateProperties class. + */ + public SecurityPolicyUpdateProperties() { + } + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyPropertiesParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: object which contains security policy parameters. + * + * @param parameters the parameters value to set. + * @return the SecurityPolicyUpdateProperties object itself. + */ + public SecurityPolicyUpdateProperties withParameters(SecurityPolicyPropertiesParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPolicyUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPolicyUpdateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityPolicyUpdateProperties. + */ + public static SecurityPolicyUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPolicyUpdateProperties deserializedSecurityPolicyUpdateProperties + = new SecurityPolicyUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedSecurityPolicyUpdateProperties.parameters + = SecurityPolicyPropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPolicyUpdateProperties; + }); + } +} 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 000000000000..46ec64b2f61c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SsoUriInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The URI required to login to the supplemental portal from the Azure portal. + */ +@Immutable +public final class SsoUriInner implements JsonSerializable { + /* + * The URI used to login to the supplemental portal. + */ + private String ssoUriValue; + + /** + * Creates an instance of SsoUriInner class. + */ + public SsoUriInner() { + } + + /** + * Get the ssoUriValue property: The URI used to login to the supplemental portal. + * + * @return the ssoUriValue value. + */ + public String ssoUriValue() { + return this.ssoUriValue; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsoUriInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsoUriInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SsoUriInner. + */ + public static SsoUriInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsoUriInner deserializedSsoUriInner = new SsoUriInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ssoUriValue".equals(fieldName)) { + deserializedSsoUriInner.ssoUriValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSsoUriInner; + }); + } +} 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 000000000000..b2a7786fcc75 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SupportedOptimizationTypesListResultInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import java.io.IOException; +import java.util.List; + +/** + * The result of the GetSupportedOptimizationTypes API. + */ +@Immutable +public final class SupportedOptimizationTypesListResultInner + implements JsonSerializable { + /* + * Supported optimization types for a profile. + */ + private List supportedOptimizationTypes; + + /** + * Creates an instance of SupportedOptimizationTypesListResultInner class. + */ + public SupportedOptimizationTypesListResultInner() { + } + + /** + * Get the supportedOptimizationTypes property: Supported optimization types for a profile. + * + * @return the supportedOptimizationTypes value. + */ + public List supportedOptimizationTypes() { + return this.supportedOptimizationTypes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SupportedOptimizationTypesListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SupportedOptimizationTypesListResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SupportedOptimizationTypesListResultInner. + */ + public static SupportedOptimizationTypesListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SupportedOptimizationTypesListResultInner deserializedSupportedOptimizationTypesListResultInner + = new SupportedOptimizationTypesListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("supportedOptimizationTypes".equals(fieldName)) { + List supportedOptimizationTypes + = reader.readArray(reader1 -> OptimizationType.fromString(reader1.getString())); + deserializedSupportedOptimizationTypesListResultInner.supportedOptimizationTypes + = supportedOptimizationTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedSupportedOptimizationTypesListResultInner; + }); + } +} 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 000000000000..0089f56a9b2c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/UsageInner.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.UsageName; +import com.azure.resourcemanager.cdn.generated.models.UsageUnit; +import java.io.IOException; + +/** + * Describes resource usage. + */ +@Fluent +public final class UsageInner implements JsonSerializable { + /* + * Resource identifier. + */ + private String id; + + /* + * An enum describing the unit of measurement. + */ + private UsageUnit unit; + + /* + * The current value of the usage. + */ + private long currentValue; + + /* + * The limit of usage. + */ + private long limit; + + /* + * The name of the type of usage. + */ + private UsageName name; + + /** + * Creates an instance of UsageInner class. + */ + public UsageInner() { + } + + /** + * Get the id property: Resource identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the unit property: An enum describing the unit of measurement. + * + * @return the unit value. + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Set the unit property: An enum describing the unit of measurement. + * + * @param unit the unit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withUnit(UsageUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + public long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: The current value of the usage. + * + * @param currentValue the currentValue value to set. + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit property: The limit of usage. + * + * @return the limit value. + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit property: The limit of usage. + * + * @param limit the limit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name property: The name of the type of usage. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name property: The name of the type of usage. + * + * @param name the name value to set. + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (unit() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property unit in model UsageInner")); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model UsageInner")); + } else { + name().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UsageInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + jsonWriter.writeLongField("currentValue", this.currentValue); + jsonWriter.writeLongField("limit", this.limit); + jsonWriter.writeJsonField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UsageInner. + */ + public static UsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageInner deserializedUsageInner = new UsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unit".equals(fieldName)) { + deserializedUsageInner.unit = UsageUnit.fromString(reader.getString()); + } else if ("currentValue".equals(fieldName)) { + deserializedUsageInner.currentValue = reader.getLong(); + } else if ("limit".equals(fieldName)) { + deserializedUsageInner.limit = reader.getLong(); + } else if ("name".equals(fieldName)) { + deserializedUsageInner.name = UsageName.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedUsageInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageInner; + }); + } +} 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 000000000000..eb8c0e4d83a6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateCustomDomainOutputInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output of custom domain validation. + */ +@Immutable +public final class ValidateCustomDomainOutputInner implements JsonSerializable { + /* + * Indicates whether the custom domain is valid or not. + */ + private Boolean customDomainValidated; + + /* + * The reason why the custom domain is not valid. + */ + private String reason; + + /* + * Error message describing why the custom domain is not valid. + */ + private String message; + + /** + * Creates an instance of ValidateCustomDomainOutputInner class. + */ + public ValidateCustomDomainOutputInner() { + } + + /** + * Get the customDomainValidated property: Indicates whether the custom domain is valid or not. + * + * @return the customDomainValidated value. + */ + public Boolean customDomainValidated() { + return this.customDomainValidated; + } + + /** + * Get the reason property: The reason why the custom domain is not valid. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: Error message describing why the custom domain is not valid. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateCustomDomainOutputInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateCustomDomainOutputInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateCustomDomainOutputInner. + */ + public static ValidateCustomDomainOutputInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateCustomDomainOutputInner deserializedValidateCustomDomainOutputInner + = new ValidateCustomDomainOutputInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customDomainValidated".equals(fieldName)) { + deserializedValidateCustomDomainOutputInner.customDomainValidated + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedValidateCustomDomainOutputInner.reason = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedValidateCustomDomainOutputInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateCustomDomainOutputInner; + }); + } +} 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 000000000000..003fc55e531f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateProbeOutputInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output of the validate probe API. + */ +@Immutable +public final class ValidateProbeOutputInner implements JsonSerializable { + /* + * Indicates whether the probe URL is accepted or not. + */ + private Boolean isValid; + + /* + * Specifies the error code when the probe url is not accepted. + */ + private String errorCode; + + /* + * The detailed error message describing why the probe URL is not accepted. + */ + private String message; + + /** + * Creates an instance of ValidateProbeOutputInner class. + */ + public ValidateProbeOutputInner() { + } + + /** + * Get the isValid property: Indicates whether the probe URL is accepted or not. + * + * @return the isValid value. + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Get the errorCode property: Specifies the error code when the probe url is not accepted. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the message property: The detailed error message describing why the probe URL is not accepted. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateProbeOutputInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateProbeOutputInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateProbeOutputInner. + */ + public static ValidateProbeOutputInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateProbeOutputInner deserializedValidateProbeOutputInner = new ValidateProbeOutputInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isValid".equals(fieldName)) { + deserializedValidateProbeOutputInner.isValid = reader.getNullable(JsonReader::getBoolean); + } else if ("errorCode".equals(fieldName)) { + deserializedValidateProbeOutputInner.errorCode = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedValidateProbeOutputInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateProbeOutputInner; + }); + } +} 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 000000000000..f7695d30d32a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateSecretOutputInner.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.Status; +import java.io.IOException; + +/** + * Output of the validated secret. + */ +@Fluent +public final class ValidateSecretOutputInner implements JsonSerializable { + /* + * The validation status. + */ + private Status status; + + /* + * Detailed error message + */ + private String message; + + /** + * Creates an instance of ValidateSecretOutputInner class. + */ + public ValidateSecretOutputInner() { + } + + /** + * Get the status property: The validation status. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The validation status. + * + * @param status the status value to set. + * @return the ValidateSecretOutputInner object itself. + */ + public ValidateSecretOutputInner withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the message property: Detailed error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Detailed error message. + * + * @param message the message value to set. + * @return the ValidateSecretOutputInner object itself. + */ + public ValidateSecretOutputInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateSecretOutputInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateSecretOutputInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateSecretOutputInner. + */ + public static ValidateSecretOutputInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateSecretOutputInner deserializedValidateSecretOutputInner = new ValidateSecretOutputInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedValidateSecretOutputInner.status = Status.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedValidateSecretOutputInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateSecretOutputInner; + }); + } +} 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 000000000000..e57a9dd443de --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafMetricsResponseInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponseSeriesItem; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Waf Metrics Response. + */ +@Fluent +public final class WafMetricsResponseInner implements JsonSerializable { + /* + * The dateTimeBegin property. + */ + private OffsetDateTime dateTimeBegin; + + /* + * The dateTimeEnd property. + */ + private OffsetDateTime dateTimeEnd; + + /* + * The granularity property. + */ + private WafMetricsGranularity granularity; + + /* + * The series property. + */ + private List series; + + /** + * Creates an instance of WafMetricsResponseInner class. + */ + public WafMetricsResponseInner() { + } + + /** + * Get the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + public OffsetDateTime dateTimeBegin() { + return this.dateTimeBegin; + } + + /** + * Set the dateTimeBegin property: The dateTimeBegin property. + * + * @param dateTimeBegin the dateTimeBegin value to set. + * @return the WafMetricsResponseInner object itself. + */ + public WafMetricsResponseInner withDateTimeBegin(OffsetDateTime dateTimeBegin) { + this.dateTimeBegin = dateTimeBegin; + return this; + } + + /** + * Get the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + public OffsetDateTime dateTimeEnd() { + return this.dateTimeEnd; + } + + /** + * Set the dateTimeEnd property: The dateTimeEnd property. + * + * @param dateTimeEnd the dateTimeEnd value to set. + * @return the WafMetricsResponseInner object itself. + */ + public WafMetricsResponseInner withDateTimeEnd(OffsetDateTime dateTimeEnd) { + this.dateTimeEnd = dateTimeEnd; + return this; + } + + /** + * Get the granularity property: The granularity property. + * + * @return the granularity value. + */ + public WafMetricsGranularity granularity() { + return this.granularity; + } + + /** + * Set the granularity property: The granularity property. + * + * @param granularity the granularity value to set. + * @return the WafMetricsResponseInner object itself. + */ + public WafMetricsResponseInner withGranularity(WafMetricsGranularity granularity) { + this.granularity = granularity; + return this; + } + + /** + * Get the series property: The series property. + * + * @return the series value. + */ + public List series() { + return this.series; + } + + /** + * Set the series property: The series property. + * + * @param series the series value to set. + * @return the WafMetricsResponseInner object itself. + */ + public WafMetricsResponseInner withSeries(List series) { + this.series = series; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (series() != null) { + series().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dateTimeBegin", + this.dateTimeBegin == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTimeBegin)); + jsonWriter.writeStringField("dateTimeEnd", + this.dateTimeEnd == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTimeEnd)); + jsonWriter.writeStringField("granularity", this.granularity == null ? null : this.granularity.toString()); + jsonWriter.writeArrayField("series", this.series, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafMetricsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafMetricsResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the WafMetricsResponseInner. + */ + public static WafMetricsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafMetricsResponseInner deserializedWafMetricsResponseInner = new WafMetricsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dateTimeBegin".equals(fieldName)) { + deserializedWafMetricsResponseInner.dateTimeBegin = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dateTimeEnd".equals(fieldName)) { + deserializedWafMetricsResponseInner.dateTimeEnd = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("granularity".equals(fieldName)) { + deserializedWafMetricsResponseInner.granularity + = WafMetricsGranularity.fromString(reader.getString()); + } else if ("series".equals(fieldName)) { + List series + = reader.readArray(reader1 -> WafMetricsResponseSeriesItem.fromJson(reader1)); + deserializedWafMetricsResponseInner.series = series; + } else { + reader.skipChildren(); + } + } + + return deserializedWafMetricsResponseInner; + }); + } +} 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 000000000000..7ac48645ffb2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafRankingsResponseInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.models.WafRankingsResponseDataItem; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Waf Rankings Response. + */ +@Fluent +public final class WafRankingsResponseInner implements JsonSerializable { + /* + * The dateTimeBegin property. + */ + private OffsetDateTime dateTimeBegin; + + /* + * The dateTimeEnd property. + */ + private OffsetDateTime dateTimeEnd; + + /* + * The groups property. + */ + private List groups; + + /* + * The data property. + */ + private List data; + + /** + * Creates an instance of WafRankingsResponseInner class. + */ + public WafRankingsResponseInner() { + } + + /** + * Get the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + public OffsetDateTime dateTimeBegin() { + return this.dateTimeBegin; + } + + /** + * Set the dateTimeBegin property: The dateTimeBegin property. + * + * @param dateTimeBegin the dateTimeBegin value to set. + * @return the WafRankingsResponseInner object itself. + */ + public WafRankingsResponseInner withDateTimeBegin(OffsetDateTime dateTimeBegin) { + this.dateTimeBegin = dateTimeBegin; + return this; + } + + /** + * Get the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + public OffsetDateTime dateTimeEnd() { + return this.dateTimeEnd; + } + + /** + * Set the dateTimeEnd property: The dateTimeEnd property. + * + * @param dateTimeEnd the dateTimeEnd value to set. + * @return the WafRankingsResponseInner object itself. + */ + public WafRankingsResponseInner withDateTimeEnd(OffsetDateTime dateTimeEnd) { + this.dateTimeEnd = dateTimeEnd; + return this; + } + + /** + * Get the groups property: The groups property. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The groups property. + * + * @param groups the groups value to set. + * @return the WafRankingsResponseInner object itself. + */ + public WafRankingsResponseInner withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the data property: The data property. + * + * @return the data value. + */ + public List data() { + return this.data; + } + + /** + * Set the data property: The data property. + * + * @param data the data value to set. + * @return the WafRankingsResponseInner object itself. + */ + public WafRankingsResponseInner withData(List data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (data() != null) { + data().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dateTimeBegin", + this.dateTimeBegin == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTimeBegin)); + jsonWriter.writeStringField("dateTimeEnd", + this.dateTimeEnd == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTimeEnd)); + jsonWriter.writeArrayField("groups", this.groups, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafRankingsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafRankingsResponseInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WafRankingsResponseInner. + */ + public static WafRankingsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafRankingsResponseInner deserializedWafRankingsResponseInner = new WafRankingsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dateTimeBegin".equals(fieldName)) { + deserializedWafRankingsResponseInner.dateTimeBegin = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dateTimeEnd".equals(fieldName)) { + deserializedWafRankingsResponseInner.dateTimeEnd = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("groups".equals(fieldName)) { + List groups = reader.readArray(reader1 -> reader1.getString()); + deserializedWafRankingsResponseInner.groups = groups; + } else if ("data".equals(fieldName)) { + List data + = reader.readArray(reader1 -> WafRankingsResponseDataItem.fromJson(reader1)); + deserializedWafRankingsResponseInner.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedWafRankingsResponseInner; + }); + } +} 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 000000000000..4633cb986ac1 --- /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,9 @@ +// 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 000000000000..c0531705bf6c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/package-info.java @@ -0,0 +1,9 @@ +// 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 000000000000..37518a44e3e5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsClientImpl.java @@ -0,0 +1,1522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.AfdCustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainListResult; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AfdCustomDomainsClient. + */ +public final class AfdCustomDomainsClientImpl implements AfdCustomDomainsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AfdCustomDomainsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdCustomDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdCustomDomainsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(AfdCustomDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdCustomDomains to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + public interface AfdCustomDomainsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AfdDomainInner customDomain, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdDomainUpdateParameters customDomainUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}/refreshValidationToken") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refreshValidationToken(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, + Context context) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String customDomainName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, + customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String customDomainName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, customDomainName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String customDomainName) { + return getWithResponseAsync(resourceGroupName, profileName, customDomainName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, + String customDomainName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, customDomainName, context).block(); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner get(String resourceGroupName, String profileName, String customDomainName) { + return getWithResponse(resourceGroupName, profileName, customDomainName, Context.NONE).getValue(); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String customDomainName, AfdDomainInner customDomain) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomain == null) { + return Mono.error(new IllegalArgumentException("Parameter customDomain is required and cannot be null.")); + } else { + customDomain.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, customDomainName, + this.client.getSubscriptionId(), this.client.getApiVersion(), customDomain, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String customDomainName, AfdDomainInner customDomain, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomain == null) { + return Mono.error(new IllegalArgumentException("Parameter customDomain is required and cannot be null.")); + } else { + customDomain.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, customDomainName, + this.client.getSubscriptionId(), this.client.getApiVersion(), customDomain, accept, context); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdDomainInner> beginCreateAsync(String resourceGroupName, + String profileName, String customDomainName, AfdDomainInner customDomain) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, customDomainName, customDomain); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdDomainInner.class, AfdDomainInner.class, this.client.getContext()); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdDomainInner> beginCreateAsync(String resourceGroupName, + String profileName, String customDomainName, AfdDomainInner customDomain, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, customDomainName, customDomain, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdDomainInner.class, AfdDomainInner.class, context); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdDomainInner> beginCreate(String resourceGroupName, + String profileName, String customDomainName, AfdDomainInner customDomain) { + return this.beginCreateAsync(resourceGroupName, profileName, customDomainName, customDomain).getSyncPoller(); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdDomainInner> beginCreate(String resourceGroupName, + String profileName, String customDomainName, AfdDomainInner customDomain, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, customDomainName, customDomain, context) + .getSyncPoller(); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String customDomainName, + AfdDomainInner customDomain) { + return beginCreateAsync(resourceGroupName, profileName, customDomainName, customDomain).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String customDomainName, + AfdDomainInner customDomain, Context context) { + return beginCreateAsync(resourceGroupName, profileName, customDomainName, customDomain, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner create(String resourceGroupName, String profileName, String customDomainName, + AfdDomainInner customDomain) { + return createAsync(resourceGroupName, profileName, customDomainName, customDomain).block(); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner create(String resourceGroupName, String profileName, String customDomainName, + AfdDomainInner customDomain, Context context) { + return createAsync(resourceGroupName, profileName, customDomainName, customDomain, context).block(); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String customDomainName, AfdDomainUpdateParameters customDomainUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter customDomainUpdateProperties is required and cannot be null.")); + } else { + customDomainUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), + customDomainUpdateProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String customDomainName, AfdDomainUpdateParameters customDomainUpdateProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter customDomainUpdateProperties is required and cannot be null.")); + } else { + customDomainUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, customDomainName, + this.client.getSubscriptionId(), this.client.getApiVersion(), customDomainUpdateProperties, accept, + context); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdDomainInner> beginUpdateAsync(String resourceGroupName, + String profileName, String customDomainName, AfdDomainUpdateParameters customDomainUpdateProperties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdDomainInner.class, AfdDomainInner.class, this.client.getContext()); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdDomainInner> beginUpdateAsync(String resourceGroupName, + String profileName, String customDomainName, AfdDomainUpdateParameters customDomainUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, + customDomainName, customDomainUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdDomainInner.class, AfdDomainInner.class, context); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdDomainInner> beginUpdate(String resourceGroupName, + String profileName, String customDomainName, AfdDomainUpdateParameters customDomainUpdateProperties) { + return this.beginUpdateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdDomainInner> beginUpdate(String resourceGroupName, + String profileName, String customDomainName, AfdDomainUpdateParameters customDomainUpdateProperties, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner update(String resourceGroupName, String profileName, String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties) { + return updateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties).block(); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner update(String resourceGroupName, String profileName, String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, Context context) { + return updateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String customDomainName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String customDomainName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, customDomainName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String customDomainName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, customDomainName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String customDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, customDomainName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String customDomainName) { + return this.beginDeleteAsync(resourceGroupName, profileName, customDomainName).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String customDomainName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, customDomainName, context).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String customDomainName) { + return beginDeleteAsync(resourceGroupName, profileName, customDomainName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String customDomainName, + Context context) { + return beginDeleteAsync(resourceGroupName, profileName, customDomainName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String customDomainName) { + deleteAsync(resourceGroupName, profileName, customDomainName).block(); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String customDomainName, Context context) { + deleteAsync(resourceGroupName, profileName, customDomainName, context).block(); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshValidationTokenWithResponseAsync(String resourceGroupName, + String profileName, String customDomainName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.refreshValidationToken(this.client.getEndpoint(), resourceGroupName, profileName, + customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshValidationTokenWithResponseAsync(String resourceGroupName, + String profileName, String customDomainName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.refreshValidationToken(this.client.getEndpoint(), resourceGroupName, profileName, + customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRefreshValidationTokenAsync(String resourceGroupName, + String profileName, String customDomainName) { + Mono>> mono + = refreshValidationTokenWithResponseAsync(resourceGroupName, profileName, customDomainName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRefreshValidationTokenAsync(String resourceGroupName, + String profileName, String customDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = refreshValidationTokenWithResponseAsync(resourceGroupName, profileName, customDomainName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRefreshValidationToken(String resourceGroupName, String profileName, + String customDomainName) { + return this.beginRefreshValidationTokenAsync(resourceGroupName, profileName, customDomainName).getSyncPoller(); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRefreshValidationToken(String resourceGroupName, String profileName, + String customDomainName, Context context) { + return this.beginRefreshValidationTokenAsync(resourceGroupName, profileName, customDomainName, context) + .getSyncPoller(); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshValidationTokenAsync(String resourceGroupName, String profileName, + String customDomainName) { + return beginRefreshValidationTokenAsync(resourceGroupName, profileName, customDomainName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshValidationTokenAsync(String resourceGroupName, String profileName, + String customDomainName, Context context) { + return beginRefreshValidationTokenAsync(resourceGroupName, profileName, customDomainName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void refreshValidationToken(String resourceGroupName, String profileName, String customDomainName) { + refreshValidationTokenAsync(resourceGroupName, profileName, customDomainName).block(); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void refreshValidationToken(String resourceGroupName, String profileName, String customDomainName, + Context context) { + refreshValidationTokenAsync(resourceGroupName, profileName, customDomainName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsImpl.java new file mode 100644 index 000000000000..6089752ccdae --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.AfdCustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.azure.resourcemanager.cdn.generated.models.AfdCustomDomains; +import com.azure.resourcemanager.cdn.generated.models.AfdDomain; + +public final class AfdCustomDomainsImpl implements AfdCustomDomains { + private static final ClientLogger LOGGER = new ClientLogger(AfdCustomDomainsImpl.class); + + private final AfdCustomDomainsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdCustomDomainsImpl(AfdCustomDomainsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AfdDomainImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner + = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AfdDomainImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String customDomainName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, customDomainName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AfdDomainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AfdDomain get(String resourceGroupName, String profileName, String customDomainName) { + AfdDomainInner inner = this.serviceClient().get(resourceGroupName, profileName, customDomainName); + if (inner != null) { + return new AfdDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String customDomainName) { + this.serviceClient().delete(resourceGroupName, profileName, customDomainName); + } + + public void delete(String resourceGroupName, String profileName, String customDomainName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, customDomainName, context); + } + + public void refreshValidationToken(String resourceGroupName, String profileName, String customDomainName) { + this.serviceClient().refreshValidationToken(resourceGroupName, profileName, customDomainName); + } + + public void refreshValidationToken(String resourceGroupName, String profileName, String customDomainName, + Context context) { + this.serviceClient().refreshValidationToken(resourceGroupName, profileName, customDomainName, context); + } + + public AfdDomain getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + this.delete(resourceGroupName, profileName, customDomainName, context); + } + + private AfdCustomDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public AfdDomainImpl define(String name) { + return new AfdDomainImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdDomainImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdDomainImpl.java new file mode 100644 index 000000000000..17af6ab2d855 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdDomainImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.azure.resourcemanager.cdn.generated.models.AfdDomain; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.DomainValidationProperties; +import com.azure.resourcemanager.cdn.generated.models.DomainValidationState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Collections; +import java.util.Map; + +public final class AfdDomainImpl implements AfdDomain, AfdDomain.Definition, AfdDomain.Update { + private AfdDomainInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DomainValidationState domainValidationState() { + return this.innerModel().domainValidationState(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Map extendedProperties() { + Map inner = this.innerModel().extendedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public DomainValidationProperties validationProperties() { + return this.innerModel().validationProperties(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public AfdDomainHttpsParameters tlsSettings() { + return this.innerModel().tlsSettings(); + } + + public ResourceReference azureDnsZone() { + return this.innerModel().azureDnsZone(); + } + + public ResourceReference preValidatedCustomDomainResourceId() { + return this.innerModel().preValidatedCustomDomainResourceId(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AfdDomainInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String customDomainName; + + private AfdDomainUpdateParameters updateCustomDomainUpdateProperties; + + public AfdDomainImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public AfdDomain create() { + this.innerObject = serviceManager.serviceClient() + .getAfdCustomDomains() + .create(resourceGroupName, profileName, customDomainName, this.innerModel(), Context.NONE); + return this; + } + + public AfdDomain create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdCustomDomains() + .create(resourceGroupName, profileName, customDomainName, this.innerModel(), context); + return this; + } + + AfdDomainImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new AfdDomainInner(); + this.serviceManager = serviceManager; + this.customDomainName = name; + } + + public AfdDomainImpl update() { + this.updateCustomDomainUpdateProperties = new AfdDomainUpdateParameters(); + return this; + } + + public AfdDomain apply() { + this.innerObject = serviceManager.serviceClient() + .getAfdCustomDomains() + .update(resourceGroupName, profileName, customDomainName, updateCustomDomainUpdateProperties, Context.NONE); + return this; + } + + public AfdDomain apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdCustomDomains() + .update(resourceGroupName, profileName, customDomainName, updateCustomDomainUpdateProperties, context); + return this; + } + + AfdDomainImpl(AfdDomainInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.customDomainName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "customDomains"); + } + + public AfdDomain refresh() { + this.innerObject = serviceManager.serviceClient() + .getAfdCustomDomains() + .getWithResponse(resourceGroupName, profileName, customDomainName, Context.NONE) + .getValue(); + return this; + } + + public AfdDomain refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdCustomDomains() + .getWithResponse(resourceGroupName, profileName, customDomainName, context) + .getValue(); + return this; + } + + public void refreshValidationToken() { + serviceManager.afdCustomDomains().refreshValidationToken(resourceGroupName, profileName, customDomainName); + } + + public void refreshValidationToken(Context context) { + serviceManager.afdCustomDomains() + .refreshValidationToken(resourceGroupName, profileName, customDomainName, context); + } + + public AfdDomainImpl withHostname(String hostname) { + this.innerModel().withHostname(hostname); + return this; + } + + public AfdDomainImpl withExtendedProperties(Map extendedProperties) { + this.innerModel().withExtendedProperties(extendedProperties); + return this; + } + + public AfdDomainImpl withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + if (isInCreateMode()) { + this.innerModel().withTlsSettings(tlsSettings); + return this; + } else { + this.updateCustomDomainUpdateProperties.withTlsSettings(tlsSettings); + return this; + } + } + + public AfdDomainImpl withAzureDnsZone(ResourceReference azureDnsZone) { + if (isInCreateMode()) { + this.innerModel().withAzureDnsZone(azureDnsZone); + return this; + } else { + this.updateCustomDomainUpdateProperties.withAzureDnsZone(azureDnsZone); + return this; + } + } + + public AfdDomainImpl withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId) { + if (isInCreateMode()) { + this.innerModel().withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + return this; + } else { + this.updateCustomDomainUpdateProperties + .withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointImpl.java new file mode 100644 index 000000000000..f38b3d8b0ab0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoint; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.Usage; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; +import java.util.Collections; +import java.util.Map; + +public final class AfdEndpointImpl implements AfdEndpoint, AfdEndpoint.Definition, AfdEndpoint.Update { + private AfdEndpointInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() { + return this.innerModel().autoGeneratedDomainNameLabelScope(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public EnabledState enabledState() { + return this.innerModel().enabledState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AfdEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private AfdEndpointUpdateParameters updateEndpointUpdateProperties; + + public AfdEndpointImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public AfdEndpoint create() { + this.innerObject = serviceManager.serviceClient() + .getAfdEndpoints() + .create(resourceGroupName, profileName, endpointName, this.innerModel(), Context.NONE); + return this; + } + + public AfdEndpoint create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdEndpoints() + .create(resourceGroupName, profileName, endpointName, this.innerModel(), context); + return this; + } + + AfdEndpointImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new AfdEndpointInner(); + this.serviceManager = serviceManager; + this.endpointName = name; + } + + public AfdEndpointImpl update() { + this.updateEndpointUpdateProperties = new AfdEndpointUpdateParameters(); + return this; + } + + public AfdEndpoint apply() { + this.innerObject = serviceManager.serviceClient() + .getAfdEndpoints() + .update(resourceGroupName, profileName, endpointName, updateEndpointUpdateProperties, Context.NONE); + return this; + } + + public AfdEndpoint apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdEndpoints() + .update(resourceGroupName, profileName, endpointName, updateEndpointUpdateProperties, context); + return this; + } + + AfdEndpointImpl(AfdEndpointInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "afdEndpoints"); + } + + public AfdEndpoint refresh() { + this.innerObject = serviceManager.serviceClient() + .getAfdEndpoints() + .getWithResponse(resourceGroupName, profileName, endpointName, Context.NONE) + .getValue(); + return this; + } + + public AfdEndpoint refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdEndpoints() + .getWithResponse(resourceGroupName, profileName, endpointName, context) + .getValue(); + return this; + } + + public void purgeContent(AfdPurgeParameters contents) { + serviceManager.afdEndpoints().purgeContent(resourceGroupName, profileName, endpointName, contents); + } + + public void purgeContent(AfdPurgeParameters contents, Context context) { + serviceManager.afdEndpoints().purgeContent(resourceGroupName, profileName, endpointName, contents, context); + } + + public PagedIterable listResourceUsage() { + return serviceManager.afdEndpoints().listResourceUsage(resourceGroupName, profileName, endpointName); + } + + public PagedIterable listResourceUsage(Context context) { + return serviceManager.afdEndpoints().listResourceUsage(resourceGroupName, profileName, endpointName, context); + } + + public Response + validateCustomDomainWithResponse(ValidateCustomDomainInput customDomainProperties, Context context) { + return serviceManager.afdEndpoints() + .validateCustomDomainWithResponse(resourceGroupName, profileName, endpointName, customDomainProperties, + context); + } + + public ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties) { + return serviceManager.afdEndpoints() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + } + + public AfdEndpointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AfdEndpointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AfdEndpointImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateEndpointUpdateProperties.withTags(tags); + return this; + } + } + + public AfdEndpointImpl + withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) { + this.innerModel().withAutoGeneratedDomainNameLabelScope(autoGeneratedDomainNameLabelScope); + return this; + } + + public AfdEndpointImpl withEnabledState(EnabledState enabledState) { + if (isInCreateMode()) { + this.innerModel().withEnabledState(enabledState); + return this; + } else { + this.updateEndpointUpdateProperties.withEnabledState(enabledState); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsClientImpl.java new file mode 100644 index 000000000000..b8e1d1b755fc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsClientImpl.java @@ -0,0 +1,2005 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.AfdEndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointListResult; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.UsagesListResult; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AfdEndpointsClient. + */ +public final class AfdEndpointsClientImpl implements AfdEndpointsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AfdEndpointsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdEndpointsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(AfdEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdEndpoints to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + public interface AfdEndpointsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AfdEndpointInner endpointParam, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdEndpointUpdateParameters endpointUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/purge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purgeContent(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AfdPurgeParameters contents, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/validateCustomDomain") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateCustomDomain(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ValidateCustomDomainInput customDomainProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, + Context context) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, + Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner get(String resourceGroupName, String profileName, String endpointName) { + return getWithResponse(resourceGroupName, profileName, endpointName, Context.NONE).getValue(); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, AfdEndpointInner endpointParam) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (endpointParam == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointParam is required and cannot be null.")); + } else { + endpointParam.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), endpointParam, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, AfdEndpointInner endpointParam, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (endpointParam == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointParam is required and cannot be null.")); + } else { + endpointParam.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), endpointParam, accept, context); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdEndpointInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, AfdEndpointInner endpointParam) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, endpointName, endpointParam); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdEndpointInner.class, AfdEndpointInner.class, this.client.getContext()); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdEndpointInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, AfdEndpointInner endpointParam, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, endpointName, endpointParam, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdEndpointInner.class, AfdEndpointInner.class, context); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdEndpointInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, AfdEndpointInner endpointParam) { + return this.beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam).getSyncPoller(); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdEndpointInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, AfdEndpointInner endpointParam, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam, context) + .getSyncPoller(); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + AfdEndpointInner endpointParam) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + AfdEndpointInner endpointParam, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner create(String resourceGroupName, String profileName, String endpointName, + AfdEndpointInner endpointParam) { + return createAsync(resourceGroupName, profileName, endpointName, endpointParam).block(); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner create(String resourceGroupName, String profileName, String endpointName, + AfdEndpointInner endpointParam, Context context) { + return createAsync(resourceGroupName, profileName, endpointName, endpointParam, context).block(); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, AfdEndpointUpdateParameters endpointUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (endpointUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null.")); + } else { + endpointUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), endpointUpdateProperties, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, AfdEndpointUpdateParameters endpointUpdateProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (endpointUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null.")); + } else { + endpointUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), endpointUpdateProperties, accept, context); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdEndpointInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, AfdEndpointUpdateParameters endpointUpdateProperties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdEndpointInner.class, AfdEndpointInner.class, this.client.getContext()); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdEndpointInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, AfdEndpointUpdateParameters endpointUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdEndpointInner.class, AfdEndpointInner.class, context); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdEndpointInner> beginUpdate(String resourceGroupName, + String profileName, String endpointName, AfdEndpointUpdateParameters endpointUpdateProperties) { + return this.beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdEndpointInner> beginUpdate(String resourceGroupName, + String profileName, String endpointName, AfdEndpointUpdateParameters endpointUpdateProperties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner update(String resourceGroupName, String profileName, String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).block(); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner update(String resourceGroupName, String profileName, String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, Context context) { + return updateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context).block(); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, endpointName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName) { + deleteAsync(resourceGroupName, profileName, endpointName).block(); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName, Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeContentWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, AfdPurgeParameters contents) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (contents == null) { + return Mono.error(new IllegalArgumentException("Parameter contents is required and cannot be null.")); + } else { + contents.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.purgeContent(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), contents, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeContentWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, AfdPurgeParameters contents, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (contents == null) { + return Mono.error(new IllegalArgumentException("Parameter contents is required and cannot be null.")); + } else { + contents.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.purgeContent(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), contents, accept, context); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeContentAsync(String resourceGroupName, String profileName, + String endpointName, AfdPurgeParameters contents) { + Mono>> mono + = purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contents); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeContentAsync(String resourceGroupName, String profileName, + String endpointName, AfdPurgeParameters contents, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contents, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurgeContent(String resourceGroupName, String profileName, + String endpointName, AfdPurgeParameters contents) { + return this.beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contents).getSyncPoller(); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurgeContent(String resourceGroupName, String profileName, + String endpointName, AfdPurgeParameters contents, Context context) { + return this.beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contents, context) + .getSyncPoller(); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeContentAsync(String resourceGroupName, String profileName, String endpointName, + AfdPurgeParameters contents) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contents).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeContentAsync(String resourceGroupName, String profileName, String endpointName, + AfdPurgeParameters contents, Context context) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contents, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purgeContent(String resourceGroupName, String profileName, String endpointName, + AfdPurgeParameters contents) { + purgeContentAsync(resourceGroupName, profileName, endpointName, contents).block(); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purgeContent(String resourceGroupName, String profileName, String endpointName, + AfdPurgeParameters contents, Context context) { + purgeContentAsync(resourceGroupName, profileName, endpointName, contents, context).block(); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + String endpointName) { + return new PagedFlux<>(() -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String endpointName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String endpointName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, + ValidateCustomDomainInput customDomainProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateCustomDomain(this.client.getEndpoint(), resourceGroupName, + profileName, endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), + customDomainProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, + ValidateCustomDomainInput customDomainProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.validateCustomDomain(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), customDomainProperties, accept, context); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateCustomDomainAsync(String resourceGroupName, + String profileName, String endpointName, ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponseAsync(resourceGroupName, profileName, endpointName, + customDomainProperties).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateCustomDomainWithResponse(String resourceGroupName, + String profileName, String endpointName, ValidateCustomDomainInput customDomainProperties, Context context) { + return validateCustomDomainWithResponseAsync(resourceGroupName, profileName, endpointName, + customDomainProperties, context).block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateCustomDomainOutputInner validateCustomDomain(String resourceGroupName, String profileName, + String endpointName, ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponse(resourceGroupName, profileName, endpointName, customDomainProperties, + Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsImpl.java new file mode 100644 index 000000000000..a7ac9afa4c1f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsImpl.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.AfdEndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoint; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoints; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.Usage; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; + +public final class AfdEndpointsImpl implements AfdEndpoints { + private static final ClientLogger LOGGER = new ClientLogger(AfdEndpointsImpl.class); + + private final AfdEndpointsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdEndpointsImpl(AfdEndpointsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AfdEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner + = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AfdEndpointImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, endpointName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AfdEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AfdEndpoint get(String resourceGroupName, String profileName, String endpointName) { + AfdEndpointInner inner = this.serviceClient().get(resourceGroupName, profileName, endpointName); + if (inner != null) { + return new AfdEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName); + } + + public void delete(String resourceGroupName, String profileName, String endpointName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, context); + } + + public void purgeContent(String resourceGroupName, String profileName, String endpointName, + AfdPurgeParameters contents) { + this.serviceClient().purgeContent(resourceGroupName, profileName, endpointName, contents); + } + + public void purgeContent(String resourceGroupName, String profileName, String endpointName, + AfdPurgeParameters contents, Context context) { + this.serviceClient().purgeContent(resourceGroupName, profileName, endpointName, contents, context); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, endpointName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName, + Context context) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, endpointName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public Response validateCustomDomainWithResponse(String resourceGroupName, + String profileName, String endpointName, ValidateCustomDomainInput customDomainProperties, Context context) { + Response inner = this.serviceClient() + .validateCustomDomainWithResponse(resourceGroupName, profileName, endpointName, customDomainProperties, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidateCustomDomainOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateCustomDomainOutput validateCustomDomain(String resourceGroupName, String profileName, + String endpointName, ValidateCustomDomainInput customDomainProperties) { + ValidateCustomDomainOutputInner inner = this.serviceClient() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + if (inner != null) { + return new ValidateCustomDomainOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public AfdEndpoint getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "afdEndpoints"); + if (endpointName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'afdEndpoints'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, context); + } + + private AfdEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public AfdEndpointImpl define(String name) { + return new AfdEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupImpl.java new file mode 100644 index 000000000000..ebd8d70788fb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroupUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.Usage; + +public final class AfdOriginGroupImpl implements AfdOriginGroup, AfdOriginGroup.Definition, AfdOriginGroup.Update { + private AfdOriginGroupInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public LoadBalancingSettingsParameters loadBalancingSettings() { + return this.innerModel().loadBalancingSettings(); + } + + public HealthProbeParameters healthProbeSettings() { + return this.innerModel().healthProbeSettings(); + } + + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerModel().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + public EnabledState sessionAffinityState() { + return this.innerModel().sessionAffinityState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AfdOriginGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String originGroupName; + + private AfdOriginGroupUpdateParameters updateOriginGroupUpdateProperties; + + public AfdOriginGroupImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public AfdOriginGroup create() { + this.innerObject = serviceManager.serviceClient() + .getAfdOriginGroups() + .create(resourceGroupName, profileName, originGroupName, this.innerModel(), Context.NONE); + return this; + } + + public AfdOriginGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdOriginGroups() + .create(resourceGroupName, profileName, originGroupName, this.innerModel(), context); + return this; + } + + AfdOriginGroupImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new AfdOriginGroupInner(); + this.serviceManager = serviceManager; + this.originGroupName = name; + } + + public AfdOriginGroupImpl update() { + this.updateOriginGroupUpdateProperties = new AfdOriginGroupUpdateParameters(); + return this; + } + + public AfdOriginGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getAfdOriginGroups() + .update(resourceGroupName, profileName, originGroupName, updateOriginGroupUpdateProperties, Context.NONE); + return this; + } + + public AfdOriginGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdOriginGroups() + .update(resourceGroupName, profileName, originGroupName, updateOriginGroupUpdateProperties, context); + return this; + } + + AfdOriginGroupImpl(AfdOriginGroupInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.originGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "originGroups"); + } + + public AfdOriginGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getAfdOriginGroups() + .getWithResponse(resourceGroupName, profileName, originGroupName, Context.NONE) + .getValue(); + return this; + } + + public AfdOriginGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdOriginGroups() + .getWithResponse(resourceGroupName, profileName, originGroupName, context) + .getValue(); + return this; + } + + public PagedIterable listResourceUsage() { + return serviceManager.afdOriginGroups().listResourceUsage(resourceGroupName, profileName, originGroupName); + } + + public PagedIterable listResourceUsage(Context context) { + return serviceManager.afdOriginGroups() + .listResourceUsage(resourceGroupName, profileName, originGroupName, context); + } + + public AfdOriginGroupImpl withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings) { + if (isInCreateMode()) { + this.innerModel().withLoadBalancingSettings(loadBalancingSettings); + return this; + } else { + this.updateOriginGroupUpdateProperties.withLoadBalancingSettings(loadBalancingSettings); + return this; + } + } + + public AfdOriginGroupImpl withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (isInCreateMode()) { + this.innerModel().withHealthProbeSettings(healthProbeSettings); + return this; + } else { + this.updateOriginGroupUpdateProperties.withHealthProbeSettings(healthProbeSettings); + return this; + } + } + + public AfdOriginGroupImpl withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (isInCreateMode()) { + this.innerModel() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } else { + this.updateOriginGroupUpdateProperties.withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + } + + public AfdOriginGroupImpl withSessionAffinityState(EnabledState sessionAffinityState) { + if (isInCreateMode()) { + this.innerModel().withSessionAffinityState(sessionAffinityState); + return this; + } else { + this.updateOriginGroupUpdateProperties.withSessionAffinityState(sessionAffinityState); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsClientImpl.java new file mode 100644 index 000000000000..a07fd0f59dd6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsClientImpl.java @@ -0,0 +1,1498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.AfdOriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroupListResult; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroupUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.UsagesListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AfdOriginGroupsClient. + */ +public final class AfdOriginGroupsClientImpl implements AfdOriginGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AfdOriginGroupsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdOriginGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdOriginGroupsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(AfdOriginGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdOriginGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + public interface AfdOriginGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdOriginGroupInner originGroup, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdOriginGroupUpdateParameters originGroupUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, + Context context) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, + Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, + originGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String originGroupName) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, + String originGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName, context).block(); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner get(String resourceGroupName, String profileName, String originGroupName) { + return getWithResponse(resourceGroupName, profileName, originGroupName, Context.NONE).getValue(); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, AfdOriginGroupInner originGroup) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter originGroup is required and cannot be null.")); + } else { + originGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), originGroup, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, AfdOriginGroupInner originGroup, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter originGroup is required and cannot be null.")); + } else { + originGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), originGroup, accept, context); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginGroupInner> beginCreateAsync(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupInner originGroup) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, originGroupName, originGroup); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdOriginGroupInner.class, AfdOriginGroupInner.class, this.client.getContext()); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginGroupInner> beginCreateAsync(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupInner originGroup, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, originGroupName, originGroup, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdOriginGroupInner.class, AfdOriginGroupInner.class, context); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginGroupInner> beginCreate(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupInner originGroup) { + return this.beginCreateAsync(resourceGroupName, profileName, originGroupName, originGroup).getSyncPoller(); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginGroupInner> beginCreate(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupInner originGroup, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, originGroupName, originGroup, context) + .getSyncPoller(); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupInner originGroup) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originGroup).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupInner originGroup, Context context) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originGroup, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner create(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupInner originGroup) { + return createAsync(resourceGroupName, profileName, originGroupName, originGroup).block(); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner create(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupInner originGroup, Context context) { + return createAsync(resourceGroupName, profileName, originGroupName, originGroup, context).block(); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originGroupUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter originGroupUpdateProperties is required and cannot be null.")); + } else { + originGroupUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + originGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), + originGroupUpdateProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, AfdOriginGroupUpdateParameters originGroupUpdateProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originGroupUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter originGroupUpdateProperties is required and cannot be null.")); + } else { + originGroupUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), originGroupUpdateProperties, accept, context); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginGroupInner> beginUpdateAsync(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdOriginGroupInner.class, AfdOriginGroupInner.class, this.client.getContext()); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginGroupInner> beginUpdateAsync(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, originGroupName, + originGroupUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdOriginGroupInner.class, AfdOriginGroupInner.class, context); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginGroupInner> beginUpdate(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + return this.beginUpdateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginGroupInner> beginUpdate(String resourceGroupName, + String profileName, String originGroupName, AfdOriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner update(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + return updateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties).block(); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner update(String resourceGroupName, String profileName, String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, Context context) { + return updateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + originGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String originGroupName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, originGroupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String originGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, originGroupName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String originGroupName) { + return this.beginDeleteAsync(resourceGroupName, profileName, originGroupName).getSyncPoller(); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String originGroupName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, originGroupName, context).getSyncPoller(); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String originGroupName) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String originGroupName, + Context context) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String originGroupName) { + deleteAsync(resourceGroupName, profileName, originGroupName).block(); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String originGroupName, Context context) { + deleteAsync(resourceGroupName, profileName, originGroupName, context).block(); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, String originGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, + originGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, String originGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + String originGroupName) { + return new PagedFlux<>(() -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, originGroupName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + String originGroupName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, originGroupName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String originGroupName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, originGroupName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String originGroupName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, originGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsImpl.java new file mode 100644 index 000000000000..7746eb4dc5f9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.AfdOriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroups; +import com.azure.resourcemanager.cdn.generated.models.Usage; + +public final class AfdOriginGroupsImpl implements AfdOriginGroups { + private static final ClientLogger LOGGER = new ClientLogger(AfdOriginGroupsImpl.class); + + private final AfdOriginGroupsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdOriginGroupsImpl(AfdOriginGroupsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AfdOriginGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner + = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AfdOriginGroupImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, + String originGroupName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, originGroupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AfdOriginGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AfdOriginGroup get(String resourceGroupName, String profileName, String originGroupName) { + AfdOriginGroupInner inner = this.serviceClient().get(resourceGroupName, profileName, originGroupName); + if (inner != null) { + return new AfdOriginGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String originGroupName) { + this.serviceClient().delete(resourceGroupName, profileName, originGroupName); + } + + public void delete(String resourceGroupName, String profileName, String originGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, originGroupName, context); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String originGroupName) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, originGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, String originGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, originGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public AfdOriginGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + this.delete(resourceGroupName, profileName, originGroupName, context); + } + + private AfdOriginGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public AfdOriginGroupImpl define(String name) { + return new AfdOriginGroupImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginImpl.java new file mode 100644 index 000000000000..3be4ea95ab0a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginImpl.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigin; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SharedPrivateLinkResourceProperties; + +public final class AfdOriginImpl implements AfdOrigin, AfdOrigin.Definition, AfdOrigin.Update { + private AfdOriginInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String originGroupName() { + return this.innerModel().originGroupName(); + } + + public ResourceReference azureOrigin() { + return this.innerModel().azureOrigin(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Integer httpPort() { + return this.innerModel().httpPort(); + } + + public Integer httpsPort() { + return this.innerModel().httpsPort(); + } + + public String originHostHeader() { + return this.innerModel().originHostHeader(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public Integer weight() { + return this.innerModel().weight(); + } + + public SharedPrivateLinkResourceProperties sharedPrivateLinkResource() { + return this.innerModel().sharedPrivateLinkResource(); + } + + public EnabledState enabledState() { + return this.innerModel().enabledState(); + } + + public Boolean enforceCertificateNameCheck() { + return this.innerModel().enforceCertificateNameCheck(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AfdOriginInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String originGroupName; + + private String originName; + + private AfdOriginUpdateParameters updateOriginUpdateProperties; + + public AfdOriginImpl withExistingOriginGroup(String resourceGroupName, String profileName, String originGroupName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.originGroupName = originGroupName; + return this; + } + + public AfdOrigin create() { + this.innerObject = serviceManager.serviceClient() + .getAfdOrigins() + .create(resourceGroupName, profileName, originGroupName, originName, this.innerModel(), Context.NONE); + return this; + } + + public AfdOrigin create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdOrigins() + .create(resourceGroupName, profileName, originGroupName, originName, this.innerModel(), context); + return this; + } + + AfdOriginImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new AfdOriginInner(); + this.serviceManager = serviceManager; + this.originName = name; + } + + public AfdOriginImpl update() { + this.updateOriginUpdateProperties = new AfdOriginUpdateParameters(); + return this; + } + + public AfdOrigin apply() { + this.innerObject = serviceManager.serviceClient() + .getAfdOrigins() + .update(resourceGroupName, profileName, originGroupName, originName, updateOriginUpdateProperties, + Context.NONE); + return this; + } + + public AfdOrigin apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdOrigins() + .update(resourceGroupName, profileName, originGroupName, originName, updateOriginUpdateProperties, context); + return this; + } + + AfdOriginImpl(AfdOriginInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.originGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "originGroups"); + this.originName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "origins"); + } + + public AfdOrigin refresh() { + this.innerObject = serviceManager.serviceClient() + .getAfdOrigins() + .getWithResponse(resourceGroupName, profileName, originGroupName, originName, Context.NONE) + .getValue(); + return this; + } + + public AfdOrigin refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAfdOrigins() + .getWithResponse(resourceGroupName, profileName, originGroupName, originName, context) + .getValue(); + return this; + } + + public AfdOriginImpl withAzureOrigin(ResourceReference azureOrigin) { + if (isInCreateMode()) { + this.innerModel().withAzureOrigin(azureOrigin); + return this; + } else { + this.updateOriginUpdateProperties.withAzureOrigin(azureOrigin); + return this; + } + } + + public AfdOriginImpl withHostname(String hostname) { + if (isInCreateMode()) { + this.innerModel().withHostname(hostname); + return this; + } else { + this.updateOriginUpdateProperties.withHostname(hostname); + return this; + } + } + + public AfdOriginImpl withHttpPort(Integer httpPort) { + if (isInCreateMode()) { + this.innerModel().withHttpPort(httpPort); + return this; + } else { + this.updateOriginUpdateProperties.withHttpPort(httpPort); + return this; + } + } + + public AfdOriginImpl withHttpsPort(Integer httpsPort) { + if (isInCreateMode()) { + this.innerModel().withHttpsPort(httpsPort); + return this; + } else { + this.updateOriginUpdateProperties.withHttpsPort(httpsPort); + return this; + } + } + + public AfdOriginImpl withOriginHostHeader(String originHostHeader) { + if (isInCreateMode()) { + this.innerModel().withOriginHostHeader(originHostHeader); + return this; + } else { + this.updateOriginUpdateProperties.withOriginHostHeader(originHostHeader); + return this; + } + } + + public AfdOriginImpl withPriority(Integer priority) { + if (isInCreateMode()) { + this.innerModel().withPriority(priority); + return this; + } else { + this.updateOriginUpdateProperties.withPriority(priority); + return this; + } + } + + public AfdOriginImpl withWeight(Integer weight) { + if (isInCreateMode()) { + this.innerModel().withWeight(weight); + return this; + } else { + this.updateOriginUpdateProperties.withWeight(weight); + return this; + } + } + + public AfdOriginImpl withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + if (isInCreateMode()) { + this.innerModel().withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } else { + this.updateOriginUpdateProperties.withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } + } + + public AfdOriginImpl withEnabledState(EnabledState enabledState) { + if (isInCreateMode()) { + this.innerModel().withEnabledState(enabledState); + return this; + } else { + this.updateOriginUpdateProperties.withEnabledState(enabledState); + return this; + } + } + + public AfdOriginImpl withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + if (isInCreateMode()) { + this.innerModel().withEnforceCertificateNameCheck(enforceCertificateNameCheck); + return this; + } else { + this.updateOriginUpdateProperties.withEnforceCertificateNameCheck(enforceCertificateNameCheck); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsClientImpl.java new file mode 100644 index 000000000000..7b3a9fda5413 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsClientImpl.java @@ -0,0 +1,1342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.AfdOriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginListResult; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AfdOriginsClient. + */ +public final class AfdOriginsClientImpl implements AfdOriginsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AfdOriginsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdOriginsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdOriginsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(AfdOriginsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdOrigins to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + public interface AfdOriginsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOriginGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdOriginInner origin, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdOriginUpdateParameters originUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOriginGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOriginGroupSinglePageAsync(String resourceGroupName, + String profileName, String originGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByOriginGroup(this.client.getEndpoint(), resourceGroupName, profileName, + originGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOriginGroupSinglePageAsync(String resourceGroupName, + String profileName, String originGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOriginGroup(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOriginGroupAsync(String resourceGroupName, String profileName, + String originGroupName) { + return new PagedFlux<>(() -> listByOriginGroupSinglePageAsync(resourceGroupName, profileName, originGroupName), + nextLink -> listByOriginGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOriginGroupAsync(String resourceGroupName, String profileName, + String originGroupName, Context context) { + return new PagedFlux<>( + () -> listByOriginGroupSinglePageAsync(resourceGroupName, profileName, originGroupName, context), + nextLink -> listByOriginGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOriginGroup(String resourceGroupName, String profileName, + String originGroupName) { + return new PagedIterable<>(listByOriginGroupAsync(resourceGroupName, profileName, originGroupName)); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOriginGroup(String resourceGroupName, String profileName, + String originGroupName, Context context) { + return new PagedIterable<>(listByOriginGroupAsync(resourceGroupName, profileName, originGroupName, context)); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, String originName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + originName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, String originName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, originName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String originGroupName, + String originName) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName, originName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, + String originGroupName, String originName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName, originName, context).block(); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner get(String resourceGroupName, String profileName, String originGroupName, String originName) { + return getWithResponse(resourceGroupName, profileName, originGroupName, originName, Context.NONE).getValue(); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, String originName, AfdOriginInner origin) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (origin == null) { + return Mono.error(new IllegalArgumentException("Parameter origin is required and cannot be null.")); + } else { + origin.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + originName, this.client.getSubscriptionId(), this.client.getApiVersion(), origin, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, String originName, AfdOriginInner origin, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (origin == null) { + return Mono.error(new IllegalArgumentException("Parameter origin is required and cannot be null.")); + } else { + origin.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, originName, + this.client.getSubscriptionId(), this.client.getApiVersion(), origin, accept, context); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginInner> beginCreateAsync(String resourceGroupName, + String profileName, String originGroupName, String originName, AfdOriginInner origin) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, originGroupName, originName, origin); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdOriginInner.class, AfdOriginInner.class, this.client.getContext()); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginInner> beginCreateAsync(String resourceGroupName, + String profileName, String originGroupName, String originName, AfdOriginInner origin, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, originGroupName, originName, origin, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdOriginInner.class, AfdOriginInner.class, context); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginInner> beginCreate(String resourceGroupName, + String profileName, String originGroupName, String originName, AfdOriginInner origin) { + return this.beginCreateAsync(resourceGroupName, profileName, originGroupName, originName, origin) + .getSyncPoller(); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginInner> beginCreate(String resourceGroupName, + String profileName, String originGroupName, String originName, AfdOriginInner origin, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, originGroupName, originName, origin, context) + .getSyncPoller(); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String originGroupName, + String originName, AfdOriginInner origin) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originName, origin).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String originGroupName, + String originName, AfdOriginInner origin, Context context) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originName, origin, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner create(String resourceGroupName, String profileName, String originGroupName, + String originName, AfdOriginInner origin) { + return createAsync(resourceGroupName, profileName, originGroupName, originName, origin).block(); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner create(String resourceGroupName, String profileName, String originGroupName, + String originName, AfdOriginInner origin, Context context) { + return createAsync(resourceGroupName, profileName, originGroupName, originName, origin, context).block(); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, String originName, AfdOriginUpdateParameters originUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null.")); + } else { + originUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + originGroupName, originName, this.client.getSubscriptionId(), this.client.getApiVersion(), + originUpdateProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, String originName, AfdOriginUpdateParameters originUpdateProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null.")); + } else { + originUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, originName, + this.client.getSubscriptionId(), this.client.getApiVersion(), originUpdateProperties, accept, context); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginInner> beginUpdateAsync(String resourceGroupName, + String profileName, String originGroupName, String originName, + AfdOriginUpdateParameters originUpdateProperties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, originGroupName, + originName, originUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdOriginInner.class, AfdOriginInner.class, this.client.getContext()); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginInner> beginUpdateAsync(String resourceGroupName, + String profileName, String originGroupName, String originName, AfdOriginUpdateParameters originUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, originGroupName, + originName, originUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AfdOriginInner.class, AfdOriginInner.class, context); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginInner> beginUpdate(String resourceGroupName, + String profileName, String originGroupName, String originName, + AfdOriginUpdateParameters originUpdateProperties) { + return this + .beginUpdateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginInner> beginUpdate(String resourceGroupName, + String profileName, String originGroupName, String originName, AfdOriginUpdateParameters originUpdateProperties, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties, + context) + .getSyncPoller(); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String originGroupName, + String originName, AfdOriginUpdateParameters originUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String originGroupName, + String originName, AfdOriginUpdateParameters originUpdateProperties, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner update(String resourceGroupName, String profileName, String originGroupName, + String originName, AfdOriginUpdateParameters originUpdateProperties) { + return updateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties).block(); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner update(String resourceGroupName, String profileName, String originGroupName, + String originName, AfdOriginUpdateParameters originUpdateProperties, Context context) { + return updateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, String originName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, + originName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String originGroupName, String originName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, originGroupName, originName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String originGroupName, String originName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, originGroupName, originName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String originGroupName, String originName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, originGroupName, originName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String originGroupName, String originName) { + return this.beginDeleteAsync(resourceGroupName, profileName, originGroupName, originName).getSyncPoller(); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String originGroupName, String originName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, originGroupName, originName, context) + .getSyncPoller(); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String originGroupName, + String originName) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName, originName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String originGroupName, + String originName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName, originName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String originGroupName, String originName) { + deleteAsync(resourceGroupName, profileName, originGroupName, originName).block(); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String originGroupName, String originName, + Context context) { + deleteAsync(resourceGroupName, profileName, originGroupName, originName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOriginGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByOriginGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOriginGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByOriginGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsImpl.java new file mode 100644 index 000000000000..ef9ec5353d2d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.AfdOriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigin; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigins; + +public final class AfdOriginsImpl implements AfdOrigins { + private static final ClientLogger LOGGER = new ClientLogger(AfdOriginsImpl.class); + + private final AfdOriginsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdOriginsImpl(AfdOriginsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByOriginGroup(String resourceGroupName, String profileName, + String originGroupName) { + PagedIterable inner + = this.serviceClient().listByOriginGroup(resourceGroupName, profileName, originGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AfdOriginImpl(inner1, this.manager())); + } + + public PagedIterable listByOriginGroup(String resourceGroupName, String profileName, + String originGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByOriginGroup(resourceGroupName, profileName, originGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AfdOriginImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String originGroupName, + String originName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, profileName, originGroupName, originName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AfdOriginImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AfdOrigin get(String resourceGroupName, String profileName, String originGroupName, String originName) { + AfdOriginInner inner = this.serviceClient().get(resourceGroupName, profileName, originGroupName, originName); + if (inner != null) { + return new AfdOriginImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String originGroupName, String originName) { + this.serviceClient().delete(resourceGroupName, profileName, originGroupName, originName); + } + + public void delete(String resourceGroupName, String profileName, String originGroupName, String originName, + Context context) { + this.serviceClient().delete(resourceGroupName, profileName, originGroupName, originName, context); + } + + public AfdOrigin getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + this.delete(resourceGroupName, profileName, originGroupName, originName, context); + } + + private AfdOriginsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public AfdOriginImpl define(String name) { + return new AfdOriginImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesClientImpl.java new file mode 100644 index 000000000000..5c89b1788e65 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesClientImpl.java @@ -0,0 +1,1035 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.AfdProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.UsagesListResult; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AfdProfilesClient. + */ +public final class AfdProfilesClientImpl implements AfdProfilesClient { + /** + * The proxy service used to perform REST calls. + */ + private final AfdProfilesService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdProfilesClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(AfdProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdProfiles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + public interface AfdProfilesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkEndpointNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkEndpointNameAvailability( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkHostNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkHostnameAvailability(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/validateSecret") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateSecret(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ValidateSecretInput validateSecretInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/upgrade") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgrade(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProfileUpgradeParameters profileUpgradeParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEndpointNameAvailabilityWithResponseAsync( + String resourceGroupName, String profileName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (checkEndpointNameAvailabilityInput == null) { + return Mono.error(new IllegalArgumentException( + "Parameter checkEndpointNameAvailabilityInput is required and cannot be null.")); + } else { + checkEndpointNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkEndpointNameAvailability(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, profileName, this.client.getApiVersion(), + checkEndpointNameAvailabilityInput, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEndpointNameAvailabilityWithResponseAsync( + String resourceGroupName, String profileName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (checkEndpointNameAvailabilityInput == null) { + return Mono.error(new IllegalArgumentException( + "Parameter checkEndpointNameAvailabilityInput is required and cannot be null.")); + } else { + checkEndpointNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkEndpointNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, profileName, this.client.getApiVersion(), checkEndpointNameAvailabilityInput, accept, + context); + } + + /** + * Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkEndpointNameAvailabilityAsync(String resourceGroupName, + String profileName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + return checkEndpointNameAvailabilityWithResponseAsync(resourceGroupName, profileName, + checkEndpointNameAvailabilityInput).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, String profileName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, Context context) { + return checkEndpointNameAvailabilityWithResponseAsync(resourceGroupName, profileName, + checkEndpointNameAvailabilityInput, context).block(); + } + + /** + * Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckEndpointNameAvailabilityOutputInner checkEndpointNameAvailability(String resourceGroupName, + String profileName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + return checkEndpointNameAvailabilityWithResponse(resourceGroupName, profileName, + checkEndpointNameAvailabilityInput, Context.NONE).getValue(); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>(() -> listResourceUsageSinglePageAsync(resourceGroupName, profileName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + Context context) { + return new PagedFlux<>(() -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, context)); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkHostnameAvailabilityWithResponseAsync( + String resourceGroupName, String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (checkHostnameAvailabilityInput == null) { + return Mono.error(new IllegalArgumentException( + "Parameter checkHostnameAvailabilityInput is required and cannot be null.")); + } else { + checkHostnameAvailabilityInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkHostnameAvailability(this.client.getEndpoint(), resourceGroupName, + profileName, this.client.getSubscriptionId(), this.client.getApiVersion(), + checkHostnameAvailabilityInput, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkHostnameAvailabilityWithResponseAsync( + String resourceGroupName, String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (checkHostnameAvailabilityInput == null) { + return Mono.error(new IllegalArgumentException( + "Parameter checkHostnameAvailabilityInput is required and cannot be null.")); + } else { + checkHostnameAvailabilityInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkHostnameAvailability(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), checkHostnameAvailabilityInput, accept, + context); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkHostnameAvailabilityAsync(String resourceGroupName, + String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput) { + return checkHostnameAvailabilityWithResponseAsync(resourceGroupName, profileName, + checkHostnameAvailabilityInput).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkHostnameAvailabilityWithResponse(String resourceGroupName, + String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, Context context) { + return checkHostnameAvailabilityWithResponseAsync(resourceGroupName, profileName, + checkHostnameAvailabilityInput, context).block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityOutputInner checkHostnameAvailability(String resourceGroupName, String profileName, + CheckHostnameAvailabilityInput checkHostnameAvailabilityInput) { + return checkHostnameAvailabilityWithResponse(resourceGroupName, profileName, checkHostnameAvailabilityInput, + Context.NONE).getValue(); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateSecretWithResponseAsync(String resourceGroupName, + String profileName, ValidateSecretInput validateSecretInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (validateSecretInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateSecretInput is required and cannot be null.")); + } else { + validateSecretInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateSecret(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), validateSecretInput, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateSecretWithResponseAsync(String resourceGroupName, + String profileName, ValidateSecretInput validateSecretInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (validateSecretInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateSecretInput is required and cannot be null.")); + } else { + validateSecretInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.validateSecret(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), validateSecretInput, accept, context); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateSecretAsync(String resourceGroupName, String profileName, + ValidateSecretInput validateSecretInput) { + return validateSecretWithResponseAsync(resourceGroupName, profileName, validateSecretInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateSecretWithResponse(String resourceGroupName, String profileName, + ValidateSecretInput validateSecretInput, Context context) { + return validateSecretWithResponseAsync(resourceGroupName, profileName, validateSecretInput, context).block(); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateSecretOutputInner validateSecret(String resourceGroupName, String profileName, + ValidateSecretInput validateSecretInput) { + return validateSecretWithResponse(resourceGroupName, profileName, validateSecretInput, Context.NONE).getValue(); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeWithResponseAsync(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (profileUpgradeParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter profileUpgradeParameters is required and cannot be null.")); + } else { + profileUpgradeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.upgrade(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), profileUpgradeParameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeWithResponseAsync(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (profileUpgradeParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter profileUpgradeParameters is required and cannot be null.")); + } else { + profileUpgradeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.upgrade(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), profileUpgradeParameters, accept, context); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginUpgradeAsync(String resourceGroupName, + String profileName, ProfileUpgradeParameters profileUpgradeParameters) { + Mono>> mono + = upgradeWithResponseAsync(resourceGroupName, profileName, profileUpgradeParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProfileInner.class, ProfileInner.class, this.client.getContext()); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginUpgradeAsync(String resourceGroupName, + String profileName, ProfileUpgradeParameters profileUpgradeParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = upgradeWithResponseAsync(resourceGroupName, profileName, profileUpgradeParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProfileInner.class, ProfileInner.class, context); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginUpgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters) { + return this.beginUpgradeAsync(resourceGroupName, profileName, profileUpgradeParameters).getSyncPoller(); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginUpgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters, Context context) { + return this.beginUpgradeAsync(resourceGroupName, profileName, profileUpgradeParameters, context) + .getSyncPoller(); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeAsync(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters) { + return beginUpgradeAsync(resourceGroupName, profileName, profileUpgradeParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeAsync(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters, Context context) { + return beginUpgradeAsync(resourceGroupName, profileName, profileUpgradeParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner upgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters) { + return upgradeAsync(resourceGroupName, profileName, profileUpgradeParameters).block(); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner upgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters, Context context) { + return upgradeAsync(resourceGroupName, profileName, profileUpgradeParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesImpl.java new file mode 100644 index 000000000000..bed17a8c46c3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.AfdProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProfiles; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityOutput; +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityOutput; +import com.azure.resourcemanager.cdn.generated.models.Profile; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.Usage; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretOutput; + +public final class AfdProfilesImpl implements AfdProfiles { + private static final ClientLogger LOGGER = new ClientLogger(AfdProfilesImpl.class); + + private final AfdProfilesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdProfilesImpl(AfdProfilesClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, String profileName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, Context context) { + Response inner = this.serviceClient() + .checkEndpointNameAvailabilityWithResponse(resourceGroupName, profileName, + checkEndpointNameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckEndpointNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckEndpointNameAvailabilityOutput checkEndpointNameAvailability(String resourceGroupName, + String profileName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + CheckEndpointNameAvailabilityOutputInner inner = this.serviceClient() + .checkEndpointNameAvailability(resourceGroupName, profileName, checkEndpointNameAvailabilityInput); + if (inner != null) { + return new CheckEndpointNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listResourceUsage(resourceGroupName, profileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public Response checkHostnameAvailabilityWithResponse(String resourceGroupName, + String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, Context context) { + Response inner = this.serviceClient() + .checkHostnameAvailabilityWithResponse(resourceGroupName, profileName, checkHostnameAvailabilityInput, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityOutput checkHostnameAvailability(String resourceGroupName, String profileName, + CheckHostnameAvailabilityInput checkHostnameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = this.serviceClient() + .checkHostnameAvailability(resourceGroupName, profileName, checkHostnameAvailabilityInput); + if (inner != null) { + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateSecretWithResponse(String resourceGroupName, String profileName, + ValidateSecretInput validateSecretInput, Context context) { + Response inner = this.serviceClient() + .validateSecretWithResponse(resourceGroupName, profileName, validateSecretInput, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidateSecretOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateSecretOutput validateSecret(String resourceGroupName, String profileName, + ValidateSecretInput validateSecretInput) { + ValidateSecretOutputInner inner + = this.serviceClient().validateSecret(resourceGroupName, profileName, validateSecretInput); + if (inner != null) { + return new ValidateSecretOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Profile upgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters) { + ProfileInner inner = this.serviceClient().upgrade(resourceGroupName, profileName, profileUpgradeParameters); + if (inner != null) { + return new ProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Profile upgrade(String resourceGroupName, String profileName, + ProfileUpgradeParameters profileUpgradeParameters, Context context) { + ProfileInner inner + = this.serviceClient().upgrade(resourceGroupName, profileName, profileUpgradeParameters, context); + if (inner != null) { + return new ProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + private AfdProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CanMigrateResultImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CanMigrateResultImpl.java new file mode 100644 index 000000000000..d41c912cee81 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CanMigrateResultImpl.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.fluent.models.CanMigrateResultInner; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateDefaultSku; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateResult; +import com.azure.resourcemanager.cdn.generated.models.MigrationErrorType; +import java.util.Collections; +import java.util.List; + +public final class CanMigrateResultImpl implements CanMigrateResult { + private CanMigrateResultInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + CanMigrateResultImpl(CanMigrateResultInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean canMigrate() { + return this.innerModel().canMigrate(); + } + + public CanMigrateDefaultSku defaultSku() { + return this.innerModel().defaultSku(); + } + + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CanMigrateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientBuilder.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientBuilder.java new file mode 100644 index 000000000000..6ecdab18db0d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientBuilder.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.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the CdnManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { CdnManagementClientImpl.class }) +public final class CdnManagementClientBuilder { + /* + * Azure Subscription ID. + */ + private String subscriptionId; + + /** + * Sets Azure Subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of CdnManagementClientImpl with the provided parameters. + * + * @return an instance of CdnManagementClientImpl. + */ + public CdnManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + CdnManagementClientImpl client = new CdnManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientImpl.java new file mode 100644 index 000000000000..044572c0ff84 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientImpl.java @@ -0,0 +1,624 @@ +// Copyright (c) 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.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.cdn.generated.fluent.AfdCustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.AfdEndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.AfdOriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.AfdOriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.AfdProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.CdnManagementClient; +import com.azure.resourcemanager.cdn.generated.fluent.CustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.EdgeNodesClient; +import com.azure.resourcemanager.cdn.generated.fluent.EndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.cdn.generated.fluent.ManagedRuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.OperationsClient; +import com.azure.resourcemanager.cdn.generated.fluent.OriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.OriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.PoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.ProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceUsagesClient; +import com.azure.resourcemanager.cdn.generated.fluent.RoutesClient; +import com.azure.resourcemanager.cdn.generated.fluent.RuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.RulesClient; +import com.azure.resourcemanager.cdn.generated.fluent.SecretsClient; +import com.azure.resourcemanager.cdn.generated.fluent.SecurityPoliciesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the CdnManagementClientImpl type. + */ +@ServiceClient(builder = CdnManagementClientBuilder.class) +public final class CdnManagementClientImpl implements CdnManagementClient { + /** + * Azure Subscription ID. + */ + private final String subscriptionId; + + /** + * Gets Azure Subscription ID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The ResourceProvidersClient object to access its operations. + */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** + * The AfdProfilesClient object to access its operations. + */ + private final AfdProfilesClient afdProfiles; + + /** + * Gets the AfdProfilesClient object to access its operations. + * + * @return the AfdProfilesClient object. + */ + public AfdProfilesClient getAfdProfiles() { + return this.afdProfiles; + } + + /** + * The AfdCustomDomainsClient object to access its operations. + */ + private final AfdCustomDomainsClient afdCustomDomains; + + /** + * Gets the AfdCustomDomainsClient object to access its operations. + * + * @return the AfdCustomDomainsClient object. + */ + public AfdCustomDomainsClient getAfdCustomDomains() { + return this.afdCustomDomains; + } + + /** + * The AfdEndpointsClient object to access its operations. + */ + private final AfdEndpointsClient afdEndpoints; + + /** + * Gets the AfdEndpointsClient object to access its operations. + * + * @return the AfdEndpointsClient object. + */ + public AfdEndpointsClient getAfdEndpoints() { + return this.afdEndpoints; + } + + /** + * The AfdOriginGroupsClient object to access its operations. + */ + private final AfdOriginGroupsClient afdOriginGroups; + + /** + * Gets the AfdOriginGroupsClient object to access its operations. + * + * @return the AfdOriginGroupsClient object. + */ + public AfdOriginGroupsClient getAfdOriginGroups() { + return this.afdOriginGroups; + } + + /** + * The AfdOriginsClient object to access its operations. + */ + private final AfdOriginsClient afdOrigins; + + /** + * Gets the AfdOriginsClient object to access its operations. + * + * @return the AfdOriginsClient object. + */ + public AfdOriginsClient getAfdOrigins() { + return this.afdOrigins; + } + + /** + * The RoutesClient object to access its operations. + */ + private final RoutesClient routes; + + /** + * Gets the RoutesClient object to access its operations. + * + * @return the RoutesClient object. + */ + public RoutesClient getRoutes() { + return this.routes; + } + + /** + * The RuleSetsClient object to access its operations. + */ + private final RuleSetsClient ruleSets; + + /** + * Gets the RuleSetsClient object to access its operations. + * + * @return the RuleSetsClient object. + */ + public RuleSetsClient getRuleSets() { + return this.ruleSets; + } + + /** + * The RulesClient object to access its operations. + */ + private final RulesClient rules; + + /** + * Gets the RulesClient object to access its operations. + * + * @return the RulesClient object. + */ + public RulesClient getRules() { + return this.rules; + } + + /** + * The SecurityPoliciesClient object to access its operations. + */ + private final SecurityPoliciesClient securityPolicies; + + /** + * Gets the SecurityPoliciesClient object to access its operations. + * + * @return the SecurityPoliciesClient object. + */ + public SecurityPoliciesClient getSecurityPolicies() { + return this.securityPolicies; + } + + /** + * The SecretsClient object to access its operations. + */ + private final SecretsClient secrets; + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + public SecretsClient getSecrets() { + return this.secrets; + } + + /** + * The LogAnalyticsClient object to access its operations. + */ + private final LogAnalyticsClient logAnalytics; + + /** + * Gets the LogAnalyticsClient object to access its operations. + * + * @return the LogAnalyticsClient object. + */ + public LogAnalyticsClient getLogAnalytics() { + return this.logAnalytics; + } + + /** + * The ProfilesClient object to access its operations. + */ + private final ProfilesClient profiles; + + /** + * Gets the ProfilesClient object to access its operations. + * + * @return the ProfilesClient object. + */ + public ProfilesClient getProfiles() { + return this.profiles; + } + + /** + * The EndpointsClient object to access its operations. + */ + private final EndpointsClient endpoints; + + /** + * Gets the EndpointsClient object to access its operations. + * + * @return the EndpointsClient object. + */ + public EndpointsClient getEndpoints() { + return this.endpoints; + } + + /** + * The OriginsClient object to access its operations. + */ + private final OriginsClient origins; + + /** + * Gets the OriginsClient object to access its operations. + * + * @return the OriginsClient object. + */ + public OriginsClient getOrigins() { + return this.origins; + } + + /** + * The OriginGroupsClient object to access its operations. + */ + private final OriginGroupsClient originGroups; + + /** + * Gets the OriginGroupsClient object to access its operations. + * + * @return the OriginGroupsClient object. + */ + public OriginGroupsClient getOriginGroups() { + return this.originGroups; + } + + /** + * The CustomDomainsClient object to access its operations. + */ + private final CustomDomainsClient customDomains; + + /** + * Gets the CustomDomainsClient object to access its operations. + * + * @return the CustomDomainsClient object. + */ + public CustomDomainsClient getCustomDomains() { + return this.customDomains; + } + + /** + * The ResourceUsagesClient object to access its operations. + */ + private final ResourceUsagesClient resourceUsages; + + /** + * Gets the ResourceUsagesClient object to access its operations. + * + * @return the ResourceUsagesClient object. + */ + public ResourceUsagesClient getResourceUsages() { + return this.resourceUsages; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The EdgeNodesClient object to access its operations. + */ + private final EdgeNodesClient edgeNodes; + + /** + * Gets the EdgeNodesClient object to access its operations. + * + * @return the EdgeNodesClient object. + */ + public EdgeNodesClient getEdgeNodes() { + return this.edgeNodes; + } + + /** + * The PoliciesClient object to access its operations. + */ + private final PoliciesClient policies; + + /** + * Gets the PoliciesClient object to access its operations. + * + * @return the PoliciesClient object. + */ + public PoliciesClient getPolicies() { + return this.policies; + } + + /** + * The ManagedRuleSetsClient object to access its operations. + */ + private final ManagedRuleSetsClient managedRuleSets; + + /** + * Gets the ManagedRuleSetsClient object to access its operations. + * + * @return the ManagedRuleSetsClient object. + */ + public ManagedRuleSetsClient getManagedRuleSets() { + return this.managedRuleSets; + } + + /** + * Initializes an instance of CdnManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Azure Subscription ID. + * @param endpoint server parameter. + */ + CdnManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2024-09-01"; + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.afdProfiles = new AfdProfilesClientImpl(this); + this.afdCustomDomains = new AfdCustomDomainsClientImpl(this); + this.afdEndpoints = new AfdEndpointsClientImpl(this); + this.afdOriginGroups = new AfdOriginGroupsClientImpl(this); + this.afdOrigins = new AfdOriginsClientImpl(this); + this.routes = new RoutesClientImpl(this); + this.ruleSets = new RuleSetsClientImpl(this); + this.rules = new RulesClientImpl(this); + this.securityPolicies = new SecurityPoliciesClientImpl(this); + this.secrets = new SecretsClientImpl(this); + this.logAnalytics = new LogAnalyticsClientImpl(this); + this.profiles = new ProfilesClientImpl(this); + this.endpoints = new EndpointsClientImpl(this); + this.origins = new OriginsClientImpl(this); + this.originGroups = new OriginGroupsClientImpl(this); + this.customDomains = new CustomDomainsClientImpl(this); + this.resourceUsages = new ResourceUsagesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.edgeNodes = new EdgeNodesClientImpl(this); + this.policies = new PoliciesClientImpl(this); + this.managedRuleSets = new ManagedRuleSetsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CdnManagementClientImpl.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnWebApplicationFirewallPolicyImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnWebApplicationFirewallPolicyImpl.java new file mode 100644 index 000000000000..636f39b7bdc8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnWebApplicationFirewallPolicyImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.CdnEndpoint; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicy; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicyPatchParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleList; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetList; +import com.azure.resourcemanager.cdn.generated.models.PolicyResourceState; +import com.azure.resourcemanager.cdn.generated.models.PolicySettings; +import com.azure.resourcemanager.cdn.generated.models.ProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRuleList; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class CdnWebApplicationFirewallPolicyImpl implements CdnWebApplicationFirewallPolicy, + CdnWebApplicationFirewallPolicy.Definition, CdnWebApplicationFirewallPolicy.Update { + private CdnWebApplicationFirewallPolicyInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PolicySettings policySettings() { + return this.innerModel().policySettings(); + } + + public RateLimitRuleList rateLimitRules() { + return this.innerModel().rateLimitRules(); + } + + public CustomRuleList customRules() { + return this.innerModel().customRules(); + } + + public ManagedRuleSetList managedRules() { + return this.innerModel().managedRules(); + } + + public List endpointLinks() { + List inner = this.innerModel().endpointLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map extendedProperties() { + Map inner = this.innerModel().extendedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PolicyResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CdnWebApplicationFirewallPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String policyName; + + private CdnWebApplicationFirewallPolicyPatchParameters updateCdnWebApplicationFirewallPolicyPatchParameters; + + public CdnWebApplicationFirewallPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CdnWebApplicationFirewallPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getPolicies() + .createOrUpdate(resourceGroupName, policyName, this.innerModel(), Context.NONE); + return this; + } + + public CdnWebApplicationFirewallPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPolicies() + .createOrUpdate(resourceGroupName, policyName, this.innerModel(), context); + return this; + } + + CdnWebApplicationFirewallPolicyImpl(String name, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new CdnWebApplicationFirewallPolicyInner(); + this.serviceManager = serviceManager; + this.policyName = name; + } + + public CdnWebApplicationFirewallPolicyImpl update() { + this.updateCdnWebApplicationFirewallPolicyPatchParameters + = new CdnWebApplicationFirewallPolicyPatchParameters(); + return this; + } + + public CdnWebApplicationFirewallPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getPolicies() + .update(resourceGroupName, policyName, updateCdnWebApplicationFirewallPolicyPatchParameters, Context.NONE); + return this; + } + + public CdnWebApplicationFirewallPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPolicies() + .update(resourceGroupName, policyName, updateCdnWebApplicationFirewallPolicyPatchParameters, context); + return this; + } + + CdnWebApplicationFirewallPolicyImpl(CdnWebApplicationFirewallPolicyInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.policyName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cdnWebApplicationFirewallPolicies"); + } + + public CdnWebApplicationFirewallPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE) + .getValue(); + return this; + } + + public CdnWebApplicationFirewallPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, context) + .getValue(); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateCdnWebApplicationFirewallPolicyPatchParameters.withTags(tags); + return this; + } + } + + public CdnWebApplicationFirewallPolicyImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withPolicySettings(PolicySettings policySettings) { + this.innerModel().withPolicySettings(policySettings); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withRateLimitRules(RateLimitRuleList rateLimitRules) { + this.innerModel().withRateLimitRules(rateLimitRules); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withCustomRules(CustomRuleList customRules) { + this.innerModel().withCustomRules(customRules); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withManagedRules(ManagedRuleSetList managedRules) { + this.innerModel().withManagedRules(managedRules); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withExtendedProperties(Map extendedProperties) { + this.innerModel().withExtendedProperties(extendedProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckEndpointNameAvailabilityOutputImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckEndpointNameAvailabilityOutputImpl.java new file mode 100644 index 000000000000..e53f960a3b88 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckEndpointNameAvailabilityOutputImpl.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.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityOutput; + +public final class CheckEndpointNameAvailabilityOutputImpl implements CheckEndpointNameAvailabilityOutput { + private CheckEndpointNameAvailabilityOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + CheckEndpointNameAvailabilityOutputImpl(CheckEndpointNameAvailabilityOutputInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String availableHostname() { + return this.innerModel().availableHostname(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckEndpointNameAvailabilityOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckNameAvailabilityOutputImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckNameAvailabilityOutputImpl.java new file mode 100644 index 000000000000..e4be0826ce49 --- /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.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityOutput; + +public final class CheckNameAvailabilityOutputImpl implements CheckNameAvailabilityOutput { + private CheckNameAvailabilityOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + CheckNameAvailabilityOutputImpl(CheckNameAvailabilityOutputInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ContinentsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ContinentsResponseImpl.java new file mode 100644 index 000000000000..9547d0223cd5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ContinentsResponseImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ContinentsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponse; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseContinentsItem; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseCountryOrRegionsItem; +import java.util.Collections; +import java.util.List; + +public final class ContinentsResponseImpl implements ContinentsResponse { + private ContinentsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ContinentsResponseImpl(ContinentsResponseInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List continents() { + List inner = this.innerModel().continents(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List countryOrRegions() { + List inner = this.innerModel().countryOrRegions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContinentsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainImpl.java new file mode 100644 index 000000000000..c4bb39624195 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainImpl.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import com.azure.resourcemanager.cdn.generated.models.CustomDomain; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainResourceState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningSubstate; + +public final class CustomDomainImpl implements CustomDomain, CustomDomain.Definition { + private CustomDomainInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + CustomDomainImpl(CustomDomainInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public CustomDomainResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public CustomHttpsProvisioningState customHttpsProvisioningState() { + return this.innerModel().customHttpsProvisioningState(); + } + + public CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate() { + return this.innerModel().customHttpsProvisioningSubstate(); + } + + public CustomDomainHttpsParameters customHttpsParameters() { + return this.innerModel().customHttpsParameters(); + } + + public String validationData() { + return this.innerModel().validationData(); + } + + public CustomHttpsProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public CustomDomainInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private String customDomainName; + + private CustomDomainParameters createCustomDomainProperties; + + public CustomDomainImpl withExistingEndpoint(String resourceGroupName, String profileName, String endpointName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.endpointName = endpointName; + return this; + } + + public CustomDomain create() { + this.innerObject = serviceManager.serviceClient() + .getCustomDomains() + .create(resourceGroupName, profileName, endpointName, customDomainName, createCustomDomainProperties, + Context.NONE); + return this; + } + + public CustomDomain create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCustomDomains() + .create(resourceGroupName, profileName, endpointName, customDomainName, createCustomDomainProperties, + context); + return this; + } + + CustomDomainImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new CustomDomainInner(); + this.serviceManager = serviceManager; + this.customDomainName = name; + this.createCustomDomainProperties = new CustomDomainParameters(); + } + + public CustomDomain refresh() { + this.innerObject = serviceManager.serviceClient() + .getCustomDomains() + .getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, Context.NONE) + .getValue(); + return this; + } + + public CustomDomain refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCustomDomains() + .getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, context) + .getValue(); + return this; + } + + public CustomDomain disableCustomHttps() { + return serviceManager.customDomains() + .disableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName); + } + + public CustomDomain disableCustomHttps(Context context) { + return serviceManager.customDomains() + .disableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, context); + } + + public CustomDomain enableCustomHttps() { + return serviceManager.customDomains() + .enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName); + } + + public CustomDomain enableCustomHttps(CustomDomainHttpsParameters customDomainHttpsParameters, Context context) { + return serviceManager.customDomains() + .enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, + customDomainHttpsParameters, context); + } + + public CustomDomainImpl withHostname(String hostname) { + this.createCustomDomainProperties.withHostname(hostname); + return this; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsClientImpl.java new file mode 100644 index 000000000000..8544b85f0972 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsClientImpl.java @@ -0,0 +1,1647 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.CustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainListResult; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CustomDomainsClient. + */ +public final class CustomDomainsClientImpl implements CustomDomainsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CustomDomainsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of CustomDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomDomainsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(CustomDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientCustomDomains to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientC") + public interface CustomDomainsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpoint(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CustomDomainParameters customDomainProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disableCustomHttps(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableCustomHttps(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CustomDomainHttpsParameters customDomainHttpsParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync(String resourceGroupName, + String profileName, String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEndpoint(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync(String resourceGroupName, + String profileName, String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByEndpoint(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync(String resourceGroupName, String profileName, + String endpointName) { + return new PagedFlux<>(() -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listByEndpointNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listByEndpointNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, + String endpointName) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, + String endpointName, Context context) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, customDomainName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, + String endpointName, String customDomainName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, context).block(); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner get(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + return getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, Context.NONE).getValue(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName, CustomDomainParameters customDomainProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), + customDomainProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName, CustomDomainParameters customDomainProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, customDomainName, + this.client.getSubscriptionId(), this.client.getApiVersion(), customDomainProperties, accept, context); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, String customDomainName, + CustomDomainParameters customDomainProperties) { + Mono>> mono = createWithResponseAsync(resourceGroupName, profileName, endpointName, + customDomainName, customDomainProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CustomDomainInner.class, CustomDomainInner.class, this.client.getContext()); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, String customDomainName, CustomDomainParameters customDomainProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceGroupName, profileName, endpointName, + customDomainName, customDomainProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CustomDomainInner.class, CustomDomainInner.class, context); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, String customDomainName, + CustomDomainParameters customDomainProperties) { + return this + .beginCreateAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties) + .getSyncPoller(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, String customDomainName, CustomDomainParameters customDomainProperties, + Context context) { + return this + .beginCreateAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, + context) + .getSyncPoller(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + String customDomainName, CustomDomainParameters customDomainProperties) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + String customDomainName, CustomDomainParameters customDomainProperties, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner create(String resourceGroupName, String profileName, String endpointName, + String customDomainName, CustomDomainParameters customDomainProperties) { + return createAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties) + .block(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner create(String resourceGroupName, String profileName, String endpointName, + String customDomainName, CustomDomainParameters customDomainProperties, Context context) { + return createAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, + context).block(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, customDomainName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginDeleteAsync(String resourceGroupName, + String profileName, String endpointName, String customDomainName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CustomDomainInner.class, CustomDomainInner.class, this.client.getContext()); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginDeleteAsync(String resourceGroupName, + String profileName, String endpointName, String customDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CustomDomainInner.class, CustomDomainInner.class, context); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginDelete(String resourceGroupName, + String profileName, String endpointName, String customDomainName) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, customDomainName).getSyncPoller(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginDelete(String resourceGroupName, + String profileName, String endpointName, String customDomainName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, customDomainName, context) + .getSyncPoller(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, customDomainName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, customDomainName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner delete(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + return deleteAsync(resourceGroupName, profileName, endpointName, customDomainName).block(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner delete(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context) { + return deleteAsync(resourceGroupName, profileName, endpointName, customDomainName, context).block(); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableCustomHttpsWithResponseAsync(String resourceGroupName, + String profileName, String endpointName, String customDomainName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.disableCustomHttps(this.client.getEndpoint(), resourceGroupName, + profileName, endpointName, customDomainName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableCustomHttpsWithResponseAsync(String resourceGroupName, + String profileName, String endpointName, String customDomainName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.disableCustomHttps(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginDisableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + Mono>> mono + = disableCustomHttpsWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CustomDomainInner.class, CustomDomainInner.class, this.client.getContext()); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginDisableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = disableCustomHttpsWithResponseAsync(resourceGroupName, profileName, + endpointName, customDomainName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CustomDomainInner.class, CustomDomainInner.class, context); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginDisableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return this.beginDisableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName) + .getSyncPoller(); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginDisableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return this + .beginDisableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, context) + .getSyncPoller(); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableCustomHttpsAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName) { + return beginDisableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableCustomHttpsAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName, Context context) { + return beginDisableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner disableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + return disableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName).block(); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner disableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context) { + return disableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, context).block(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableCustomHttpsWithResponseAsync(String resourceGroupName, + String profileName, String endpointName, String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainHttpsParameters != null) { + customDomainHttpsParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.enableCustomHttps(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), + customDomainHttpsParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableCustomHttpsWithResponseAsync(String resourceGroupName, + String profileName, String endpointName, String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainHttpsParameters != null) { + customDomainHttpsParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.enableCustomHttps(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + customDomainName, this.client.getSubscriptionId(), this.client.getApiVersion(), customDomainHttpsParameters, + accept, context); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginEnableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters) { + Mono>> mono = enableCustomHttpsWithResponseAsync(resourceGroupName, profileName, + endpointName, customDomainName, customDomainHttpsParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CustomDomainInner.class, CustomDomainInner.class, this.client.getContext()); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginEnableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + Mono>> mono = enableCustomHttpsWithResponseAsync(resourceGroupName, profileName, + endpointName, customDomainName, customDomainHttpsParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CustomDomainInner.class, CustomDomainInner.class, this.client.getContext()); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginEnableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = enableCustomHttpsWithResponseAsync(resourceGroupName, profileName, + endpointName, customDomainName, customDomainHttpsParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CustomDomainInner.class, CustomDomainInner.class, context); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginEnableCustomHttps(String resourceGroupName, + String profileName, String endpointName, String customDomainName) { + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + return this + .beginEnableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, + customDomainHttpsParameters) + .getSyncPoller(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginEnableCustomHttps(String resourceGroupName, + String profileName, String endpointName, String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, Context context) { + return this + .beginEnableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, + customDomainHttpsParameters, context) + .getSyncPoller(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableCustomHttpsAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters) { + return beginEnableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, + customDomainHttpsParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableCustomHttpsAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName) { + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + return beginEnableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, + customDomainHttpsParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableCustomHttpsAsync(String resourceGroupName, String profileName, + String endpointName, String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters, + Context context) { + return beginEnableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, + customDomainHttpsParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner enableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + return enableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, + customDomainHttpsParameters).block(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner enableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters, Context context) { + return enableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, + customDomainHttpsParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEndpointNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByEndpointNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsImpl.java new file mode 100644 index 000000000000..d1357fde94d3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.CustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import com.azure.resourcemanager.cdn.generated.models.CustomDomain; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomains; + +public final class CustomDomainsImpl implements CustomDomains { + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainsImpl.class); + + private final CustomDomainsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public CustomDomainsImpl(CustomDomainsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, + String endpointName) { + PagedIterable inner + = this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomDomainImpl(inner1, this.manager())); + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context) { + PagedIterable inner + = this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomDomainImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CustomDomainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomDomain get(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + CustomDomainInner inner + = this.serviceClient().get(resourceGroupName, profileName, endpointName, customDomainName); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain delete(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + CustomDomainInner inner + = this.serviceClient().delete(resourceGroupName, profileName, endpointName, customDomainName); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain delete(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context) { + CustomDomainInner inner + = this.serviceClient().delete(resourceGroupName, profileName, endpointName, customDomainName, context); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain disableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + CustomDomainInner inner + = this.serviceClient().disableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain disableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context) { + CustomDomainInner inner = this.serviceClient() + .disableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, context); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain enableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName) { + CustomDomainInner inner + = this.serviceClient().enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain enableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters, Context context) { + CustomDomainInner inner = this.serviceClient() + .enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, + customDomainHttpsParameters, context); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + return this.delete(resourceGroupName, profileName, endpointName, customDomainName, context); + } + + private CustomDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public CustomDomainImpl define(String name) { + return new CustomDomainImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodeImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodeImpl.java new file mode 100644 index 000000000000..9c2effe03f74 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodeImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import com.azure.resourcemanager.cdn.generated.models.EdgeNode; +import com.azure.resourcemanager.cdn.generated.models.IpAddressGroup; +import java.util.Collections; +import java.util.List; + +public final class EdgeNodeImpl implements EdgeNode { + private EdgeNodeInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + EdgeNodeImpl(EdgeNodeInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List ipAddressGroups() { + List inner = this.innerModel().ipAddressGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EdgeNodeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesClientImpl.java new file mode 100644 index 000000000000..3cd721b7dee8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.EdgeNodesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import com.azure.resourcemanager.cdn.generated.models.EdgenodeResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EdgeNodesClient. + */ +public final class EdgeNodesClientImpl implements EdgeNodesClient { + /** + * The proxy service used to perform REST calls. + */ + private final EdgeNodesService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of EdgeNodesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EdgeNodesClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(EdgeNodesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientEdgeNodes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientE") + public interface EdgeNodesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Cdn/edgenodes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesImpl.java new file mode 100644 index 000000000000..a5926e24e806 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.EdgeNodesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import com.azure.resourcemanager.cdn.generated.models.EdgeNode; +import com.azure.resourcemanager.cdn.generated.models.EdgeNodes; + +public final class EdgeNodesImpl implements EdgeNodes { + private static final ClientLogger LOGGER = new ClientLogger(EdgeNodesImpl.class); + + private final EdgeNodesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public EdgeNodesImpl(EdgeNodesClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeNodeImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeNodeImpl(inner1, this.manager())); + } + + private EdgeNodesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointImpl.java new file mode 100644 index 000000000000..96c085ad3d50 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointImpl.java @@ -0,0 +1,504 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedCustomDomain; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOrigin; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.Endpoint; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersDeliveryPolicy; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.cdn.generated.models.EndpointProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.EndpointResourceState; +import com.azure.resourcemanager.cdn.generated.models.EndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.GeoFilter; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.QueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.UrlSigningKey; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class EndpointImpl implements Endpoint, Endpoint.Definition, Endpoint.Update { + private EndpointInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public List origins() { + List inner = this.innerModel().origins(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List originGroups() { + List inner = this.innerModel().originGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List customDomains() { + List inner = this.innerModel().customDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EndpointResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public EndpointProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String originPath() { + return this.innerModel().originPath(); + } + + public List contentTypesToCompress() { + List inner = this.innerModel().contentTypesToCompress(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String originHostHeader() { + return this.innerModel().originHostHeader(); + } + + public Boolean isCompressionEnabled() { + return this.innerModel().isCompressionEnabled(); + } + + public Boolean isHttpAllowed() { + return this.innerModel().isHttpAllowed(); + } + + public Boolean isHttpsAllowed() { + return this.innerModel().isHttpsAllowed(); + } + + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.innerModel().queryStringCachingBehavior(); + } + + public OptimizationType optimizationType() { + return this.innerModel().optimizationType(); + } + + public String probePath() { + return this.innerModel().probePath(); + } + + public List geoFilters() { + List inner = this.innerModel().geoFilters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceReference defaultOriginGroup() { + return this.innerModel().defaultOriginGroup(); + } + + public List urlSigningKeys() { + List inner = this.innerModel().urlSigningKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.innerModel().deliveryPolicy(); + } + + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.innerModel().webApplicationFirewallPolicyLink(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private EndpointUpdateParameters updateEndpointUpdateProperties; + + public EndpointImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public Endpoint create() { + this.innerObject = serviceManager.serviceClient() + .getEndpoints() + .create(resourceGroupName, profileName, endpointName, this.innerModel(), Context.NONE); + return this; + } + + public Endpoint create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEndpoints() + .create(resourceGroupName, profileName, endpointName, this.innerModel(), context); + return this; + } + + EndpointImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new EndpointInner(); + this.serviceManager = serviceManager; + this.endpointName = name; + } + + public EndpointImpl update() { + this.updateEndpointUpdateProperties = new EndpointUpdateParameters(); + return this; + } + + public Endpoint apply() { + this.innerObject = serviceManager.serviceClient() + .getEndpoints() + .update(resourceGroupName, profileName, endpointName, updateEndpointUpdateProperties, Context.NONE); + return this; + } + + public Endpoint apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEndpoints() + .update(resourceGroupName, profileName, endpointName, updateEndpointUpdateProperties, context); + return this; + } + + EndpointImpl(EndpointInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "endpoints"); + } + + public Endpoint refresh() { + this.innerObject = serviceManager.serviceClient() + .getEndpoints() + .getWithResponse(resourceGroupName, profileName, endpointName, Context.NONE) + .getValue(); + return this; + } + + public Endpoint refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEndpoints() + .getWithResponse(resourceGroupName, profileName, endpointName, context) + .getValue(); + return this; + } + + public Endpoint start() { + return serviceManager.endpoints().start(resourceGroupName, profileName, endpointName); + } + + public Endpoint start(Context context) { + return serviceManager.endpoints().start(resourceGroupName, profileName, endpointName, context); + } + + public Endpoint stop() { + return serviceManager.endpoints().stop(resourceGroupName, profileName, endpointName); + } + + public Endpoint stop(Context context) { + return serviceManager.endpoints().stop(resourceGroupName, profileName, endpointName, context); + } + + public void purgeContent(PurgeParameters contentFilePaths) { + serviceManager.endpoints().purgeContent(resourceGroupName, profileName, endpointName, contentFilePaths); + } + + public void purgeContent(PurgeParameters contentFilePaths, Context context) { + serviceManager.endpoints() + .purgeContent(resourceGroupName, profileName, endpointName, contentFilePaths, context); + } + + public void loadContent(LoadParameters contentFilePaths) { + serviceManager.endpoints().loadContent(resourceGroupName, profileName, endpointName, contentFilePaths); + } + + public void loadContent(LoadParameters contentFilePaths, Context context) { + serviceManager.endpoints().loadContent(resourceGroupName, profileName, endpointName, contentFilePaths, context); + } + + public Response + validateCustomDomainWithResponse(ValidateCustomDomainInput customDomainProperties, Context context) { + return serviceManager.endpoints() + .validateCustomDomainWithResponse(resourceGroupName, profileName, endpointName, customDomainProperties, + context); + } + + public ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties) { + return serviceManager.endpoints() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + } + + public PagedIterable listResourceUsage() { + return serviceManager.endpoints().listResourceUsage(resourceGroupName, profileName, endpointName); + } + + public PagedIterable listResourceUsage(Context context) { + return serviceManager.endpoints().listResourceUsage(resourceGroupName, profileName, endpointName, context); + } + + public EndpointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EndpointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EndpointImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateEndpointUpdateProperties.withTags(tags); + return this; + } + } + + public EndpointImpl withOrigins(List origins) { + this.innerModel().withOrigins(origins); + return this; + } + + public EndpointImpl withOriginGroups(List originGroups) { + this.innerModel().withOriginGroups(originGroups); + return this; + } + + public EndpointImpl withOriginPath(String originPath) { + if (isInCreateMode()) { + this.innerModel().withOriginPath(originPath); + return this; + } else { + this.updateEndpointUpdateProperties.withOriginPath(originPath); + return this; + } + } + + public EndpointImpl withContentTypesToCompress(List contentTypesToCompress) { + if (isInCreateMode()) { + this.innerModel().withContentTypesToCompress(contentTypesToCompress); + return this; + } else { + this.updateEndpointUpdateProperties.withContentTypesToCompress(contentTypesToCompress); + return this; + } + } + + public EndpointImpl withOriginHostHeader(String originHostHeader) { + if (isInCreateMode()) { + this.innerModel().withOriginHostHeader(originHostHeader); + return this; + } else { + this.updateEndpointUpdateProperties.withOriginHostHeader(originHostHeader); + return this; + } + } + + public EndpointImpl withIsCompressionEnabled(Boolean isCompressionEnabled) { + if (isInCreateMode()) { + this.innerModel().withIsCompressionEnabled(isCompressionEnabled); + return this; + } else { + this.updateEndpointUpdateProperties.withIsCompressionEnabled(isCompressionEnabled); + return this; + } + } + + public EndpointImpl withIsHttpAllowed(Boolean isHttpAllowed) { + if (isInCreateMode()) { + this.innerModel().withIsHttpAllowed(isHttpAllowed); + return this; + } else { + this.updateEndpointUpdateProperties.withIsHttpAllowed(isHttpAllowed); + return this; + } + } + + public EndpointImpl withIsHttpsAllowed(Boolean isHttpsAllowed) { + if (isInCreateMode()) { + this.innerModel().withIsHttpsAllowed(isHttpsAllowed); + return this; + } else { + this.updateEndpointUpdateProperties.withIsHttpsAllowed(isHttpsAllowed); + return this; + } + } + + public EndpointImpl withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + if (isInCreateMode()) { + this.innerModel().withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } else { + this.updateEndpointUpdateProperties.withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } + } + + public EndpointImpl withOptimizationType(OptimizationType optimizationType) { + if (isInCreateMode()) { + this.innerModel().withOptimizationType(optimizationType); + return this; + } else { + this.updateEndpointUpdateProperties.withOptimizationType(optimizationType); + return this; + } + } + + public EndpointImpl withProbePath(String probePath) { + if (isInCreateMode()) { + this.innerModel().withProbePath(probePath); + return this; + } else { + this.updateEndpointUpdateProperties.withProbePath(probePath); + return this; + } + } + + public EndpointImpl withGeoFilters(List geoFilters) { + if (isInCreateMode()) { + this.innerModel().withGeoFilters(geoFilters); + return this; + } else { + this.updateEndpointUpdateProperties.withGeoFilters(geoFilters); + return this; + } + } + + public EndpointImpl withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + if (isInCreateMode()) { + this.innerModel().withDefaultOriginGroup(defaultOriginGroup); + return this; + } else { + this.updateEndpointUpdateProperties.withDefaultOriginGroup(defaultOriginGroup); + return this; + } + } + + public EndpointImpl withUrlSigningKeys(List urlSigningKeys) { + if (isInCreateMode()) { + this.innerModel().withUrlSigningKeys(urlSigningKeys); + return this; + } else { + this.updateEndpointUpdateProperties.withUrlSigningKeys(urlSigningKeys); + return this; + } + } + + public EndpointImpl withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + if (isInCreateMode()) { + this.innerModel().withDeliveryPolicy(deliveryPolicy); + return this; + } else { + this.updateEndpointUpdateProperties.withDeliveryPolicy(deliveryPolicy); + return this; + } + } + + public EndpointImpl withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + if (isInCreateMode()) { + this.innerModel().withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } else { + this.updateEndpointUpdateProperties.withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsClientImpl.java new file mode 100644 index 000000000000..89570982f6a7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsClientImpl.java @@ -0,0 +1,2701 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.EndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.EndpointListResult; +import com.azure.resourcemanager.cdn.generated.models.EndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageListResult; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EndpointsClient. + */ +public final class EndpointsClientImpl implements EndpointsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EndpointsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of EndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EndpointsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(EndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientEndpoints to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientE") + public interface EndpointsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") EndpointInner endpointParam, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EndpointUpdateParameters endpointUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purgeContent(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PurgeParameters contentFilePaths, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> loadContent(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LoadParameters contentFilePaths, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateCustomDomain(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ValidateCustomDomainInput customDomainProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/checkResourceUsage") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner get(String resourceGroupName, String profileName, String endpointName) { + return getWithResponse(resourceGroupName, profileName, endpointName, Context.NONE).getValue(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, EndpointInner endpointParam) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (endpointParam == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointParam is required and cannot be null.")); + } else { + endpointParam.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), endpointParam, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, EndpointInner endpointParam, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (endpointParam == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointParam is required and cannot be null.")); + } else { + endpointParam.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), endpointParam, accept, context); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, EndpointInner endpointParam) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, endpointName, endpointParam); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EndpointInner.class, EndpointInner.class, this.client.getContext()); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, EndpointInner endpointParam, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, endpointName, endpointParam, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EndpointInner.class, EndpointInner.class, context); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, EndpointInner endpointParam) { + return this.beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam).getSyncPoller(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, EndpointInner endpointParam, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam, context) + .getSyncPoller(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + EndpointInner endpointParam) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + EndpointInner endpointParam, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner create(String resourceGroupName, String profileName, String endpointName, + EndpointInner endpointParam) { + return createAsync(resourceGroupName, profileName, endpointName, endpointParam).block(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner create(String resourceGroupName, String profileName, String endpointName, + EndpointInner endpointParam, Context context) { + return createAsync(resourceGroupName, profileName, endpointName, endpointParam, context).block(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, EndpointUpdateParameters endpointUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (endpointUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null.")); + } else { + endpointUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), endpointUpdateProperties, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, EndpointUpdateParameters endpointUpdateProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (endpointUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null.")); + } else { + endpointUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), endpointUpdateProperties, accept, context); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EndpointInner.class, EndpointInner.class, this.client.getContext()); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EndpointInner.class, EndpointInner.class, context); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginUpdate(String resourceGroupName, + String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties) { + return this.beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginUpdate(String resourceGroupName, + String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties, Context context) { + return this.beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + EndpointUpdateParameters endpointUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + EndpointUpdateParameters endpointUpdateProperties, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner update(String resourceGroupName, String profileName, String endpointName, + EndpointUpdateParameters endpointUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).block(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner update(String resourceGroupName, String profileName, String endpointName, + EndpointUpdateParameters endpointUpdateProperties, Context context) { + return updateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context).block(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, endpointName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName).getSyncPoller(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName) { + deleteAsync(resourceGroupName, profileName, endpointName).block(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName, Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String profileName, + String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.start(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginStartAsync(String resourceGroupName, + String profileName, String endpointName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, profileName, endpointName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EndpointInner.class, EndpointInner.class, this.client.getContext()); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginStartAsync(String resourceGroupName, + String profileName, String endpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = startWithResponseAsync(resourceGroupName, profileName, endpointName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EndpointInner.class, EndpointInner.class, context); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginStart(String resourceGroupName, String profileName, + String endpointName) { + return this.beginStartAsync(resourceGroupName, profileName, endpointName).getSyncPoller(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginStart(String resourceGroupName, String profileName, + String endpointName, Context context) { + return this.beginStartAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String profileName, String endpointName) { + return beginStartAsync(resourceGroupName, profileName, endpointName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String profileName, String endpointName, + Context context) { + return beginStartAsync(resourceGroupName, profileName, endpointName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner start(String resourceGroupName, String profileName, String endpointName) { + return startAsync(resourceGroupName, profileName, endpointName).block(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner start(String resourceGroupName, String profileName, String endpointName, Context context) { + return startAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceGroupName, String profileName, + String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.stop(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stop(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginStopAsync(String resourceGroupName, + String profileName, String endpointName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, profileName, endpointName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EndpointInner.class, EndpointInner.class, this.client.getContext()); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginStopAsync(String resourceGroupName, + String profileName, String endpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = stopWithResponseAsync(resourceGroupName, profileName, endpointName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EndpointInner.class, EndpointInner.class, context); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginStop(String resourceGroupName, String profileName, + String endpointName) { + return this.beginStopAsync(resourceGroupName, profileName, endpointName).getSyncPoller(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginStop(String resourceGroupName, String profileName, + String endpointName, Context context) { + return this.beginStopAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String profileName, String endpointName) { + return beginStopAsync(resourceGroupName, profileName, endpointName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String profileName, String endpointName, + Context context) { + return beginStopAsync(resourceGroupName, profileName, endpointName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner stop(String resourceGroupName, String profileName, String endpointName) { + return stopAsync(resourceGroupName, profileName, endpointName).block(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner stop(String resourceGroupName, String profileName, String endpointName, Context context) { + return stopAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeContentWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, PurgeParameters contentFilePaths) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (contentFilePaths == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentFilePaths is required and cannot be null.")); + } else { + contentFilePaths.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.purgeContent(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), contentFilePaths, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeContentWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, PurgeParameters contentFilePaths, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (contentFilePaths == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentFilePaths is required and cannot be null.")); + } else { + contentFilePaths.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.purgeContent(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), contentFilePaths, accept, context); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeContentAsync(String resourceGroupName, String profileName, + String endpointName, PurgeParameters contentFilePaths) { + Mono>> mono + = purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contentFilePaths); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeContentAsync(String resourceGroupName, String profileName, + String endpointName, PurgeParameters contentFilePaths, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurgeContent(String resourceGroupName, String profileName, + String endpointName, PurgeParameters contentFilePaths) { + return this.beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths) + .getSyncPoller(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurgeContent(String resourceGroupName, String profileName, + String endpointName, PurgeParameters contentFilePaths, Context context) { + return this.beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context) + .getSyncPoller(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeContentAsync(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeContentAsync(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths, Context context) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purgeContent(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths) { + purgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths).block(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purgeContent(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths, Context context) { + purgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context).block(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> loadContentWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, LoadParameters contentFilePaths) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (contentFilePaths == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentFilePaths is required and cannot be null.")); + } else { + contentFilePaths.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.loadContent(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), contentFilePaths, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> loadContentWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, LoadParameters contentFilePaths, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (contentFilePaths == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentFilePaths is required and cannot be null.")); + } else { + contentFilePaths.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.loadContent(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), contentFilePaths, accept, context); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginLoadContentAsync(String resourceGroupName, String profileName, + String endpointName, LoadParameters contentFilePaths) { + Mono>> mono + = loadContentWithResponseAsync(resourceGroupName, profileName, endpointName, contentFilePaths); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginLoadContentAsync(String resourceGroupName, String profileName, + String endpointName, LoadParameters contentFilePaths, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = loadContentWithResponseAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginLoadContent(String resourceGroupName, String profileName, + String endpointName, LoadParameters contentFilePaths) { + return this.beginLoadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths) + .getSyncPoller(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginLoadContent(String resourceGroupName, String profileName, + String endpointName, LoadParameters contentFilePaths, Context context) { + return this.beginLoadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context) + .getSyncPoller(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono loadContentAsync(String resourceGroupName, String profileName, String endpointName, + LoadParameters contentFilePaths) { + return beginLoadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono loadContentAsync(String resourceGroupName, String profileName, String endpointName, + LoadParameters contentFilePaths, Context context) { + return beginLoadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void loadContent(String resourceGroupName, String profileName, String endpointName, + LoadParameters contentFilePaths) { + loadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths).block(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void loadContent(String resourceGroupName, String profileName, String endpointName, + LoadParameters contentFilePaths, Context context) { + loadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context).block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, + ValidateCustomDomainInput customDomainProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateCustomDomain(this.client.getEndpoint(), resourceGroupName, + profileName, endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), + customDomainProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, + ValidateCustomDomainInput customDomainProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (customDomainProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.validateCustomDomain(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), customDomainProperties, accept, context); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateCustomDomainAsync(String resourceGroupName, + String profileName, String endpointName, ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponseAsync(resourceGroupName, profileName, endpointName, + customDomainProperties).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateCustomDomainWithResponse(String resourceGroupName, + String profileName, String endpointName, ValidateCustomDomainInput customDomainProperties, Context context) { + return validateCustomDomainWithResponseAsync(resourceGroupName, profileName, endpointName, + customDomainProperties, context).block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateCustomDomainOutputInner validateCustomDomain(String resourceGroupName, String profileName, + String endpointName, ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponse(resourceGroupName, profileName, endpointName, customDomainProperties, + Context.NONE).getValue(); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + String endpointName) { + return new PagedFlux<>(() -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String endpointName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String endpointName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsImpl.java new file mode 100644 index 000000000000..319554cb0fa6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsImpl.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.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.EndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.Endpoint; +import com.azure.resourcemanager.cdn.generated.models.Endpoints; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; + +public final class EndpointsImpl implements Endpoints { + private static final ClientLogger LOGGER = new ClientLogger(EndpointsImpl.class); + + private final EndpointsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public EndpointsImpl(EndpointsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner + = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EndpointImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, endpointName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Endpoint get(String resourceGroupName, String profileName, String endpointName) { + EndpointInner inner = this.serviceClient().get(resourceGroupName, profileName, endpointName); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName); + } + + public void delete(String resourceGroupName, String profileName, String endpointName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, context); + } + + public Endpoint start(String resourceGroupName, String profileName, String endpointName) { + EndpointInner inner = this.serviceClient().start(resourceGroupName, profileName, endpointName); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Endpoint start(String resourceGroupName, String profileName, String endpointName, Context context) { + EndpointInner inner = this.serviceClient().start(resourceGroupName, profileName, endpointName, context); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Endpoint stop(String resourceGroupName, String profileName, String endpointName) { + EndpointInner inner = this.serviceClient().stop(resourceGroupName, profileName, endpointName); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Endpoint stop(String resourceGroupName, String profileName, String endpointName, Context context) { + EndpointInner inner = this.serviceClient().stop(resourceGroupName, profileName, endpointName, context); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public void purgeContent(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths) { + this.serviceClient().purgeContent(resourceGroupName, profileName, endpointName, contentFilePaths); + } + + public void purgeContent(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths, Context context) { + this.serviceClient().purgeContent(resourceGroupName, profileName, endpointName, contentFilePaths, context); + } + + public void loadContent(String resourceGroupName, String profileName, String endpointName, + LoadParameters contentFilePaths) { + this.serviceClient().loadContent(resourceGroupName, profileName, endpointName, contentFilePaths); + } + + public void loadContent(String resourceGroupName, String profileName, String endpointName, + LoadParameters contentFilePaths, Context context) { + this.serviceClient().loadContent(resourceGroupName, profileName, endpointName, contentFilePaths, context); + } + + public Response validateCustomDomainWithResponse(String resourceGroupName, + String profileName, String endpointName, ValidateCustomDomainInput customDomainProperties, Context context) { + Response inner = this.serviceClient() + .validateCustomDomainWithResponse(resourceGroupName, profileName, endpointName, customDomainProperties, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidateCustomDomainOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateCustomDomainOutput validateCustomDomain(String resourceGroupName, String profileName, + String endpointName, ValidateCustomDomainInput customDomainProperties) { + ValidateCustomDomainOutputInner inner = this.serviceClient() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + if (inner != null) { + return new ValidateCustomDomainOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String endpointName) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, endpointName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String endpointName, Context context) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, endpointName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public Endpoint getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, context); + } + + private EndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public EndpointImpl define(String name) { + return new EndpointImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsClientImpl.java new file mode 100644 index 000000000000..f9202f0e2b3d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsClientImpl.java @@ -0,0 +1,1312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ContinentsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafRankingGroupBy; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import com.azure.resourcemanager.cdn.generated.models.WafRuleType; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LogAnalyticsClient. + */ +public final class LogAnalyticsClientImpl implements LogAnalyticsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LogAnalyticsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of LogAnalyticsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogAnalyticsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(LogAnalyticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientLogAnalytics to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientL") + public interface LogAnalyticsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsMetrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogAnalyticsMetrics(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @QueryParam(value = "metrics", multipleQueryParams = true) List metrics, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam("granularity") LogMetricsGranularity granularity, + @QueryParam(value = "groupBy", multipleQueryParams = true) List groupBy, + @QueryParam(value = "continents", multipleQueryParams = true) List continents, + @QueryParam(value = "countryOrRegions", multipleQueryParams = true) List countryOrRegions, + @QueryParam(value = "customDomains", multipleQueryParams = true) List customDomains, + @QueryParam(value = "protocols", multipleQueryParams = true) List protocols, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsRankings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogAnalyticsRankings(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @QueryParam(value = "rankings", multipleQueryParams = true) List rankings, + @QueryParam(value = "metrics", multipleQueryParams = true) List metrics, + @QueryParam("maxRanking") int maxRanking, @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam(value = "customDomains", multipleQueryParams = true) List customDomains, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsLocations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogAnalyticsLocations(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogAnalyticsResources(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getWafLogAnalyticsMetrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getWafLogAnalyticsMetrics(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @QueryParam(value = "metrics", multipleQueryParams = true) List metrics, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam("granularity") WafGranularity granularity, + @QueryParam(value = "actions", multipleQueryParams = true) List actions, + @QueryParam(value = "groupBy", multipleQueryParams = true) List groupBy, + @QueryParam(value = "ruleTypes", multipleQueryParams = true) List ruleTypes, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getWafLogAnalyticsRankings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getWafLogAnalyticsRankings(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @QueryParam(value = "metrics", multipleQueryParams = true) List metrics, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, @QueryParam("maxRanking") int maxRanking, + @QueryParam(value = "rankings", multipleQueryParams = true) List rankings, + @QueryParam(value = "actions", multipleQueryParams = true) List actions, + @QueryParam(value = "ruleTypes", multipleQueryParams = true) List ruleTypes, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains The customDomains parameter. + * @param protocols The protocols parameter. + * @param groupBy The groupBy parameter. + * @param continents The continents parameter. + * @param countryOrRegions The countryOrRegions 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 report for AFD profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsMetricsWithResponseAsync(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, List customDomains, List protocols, + List groupBy, List continents, List countryOrRegions) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (granularity == null) { + return Mono.error(new IllegalArgumentException("Parameter granularity is required and cannot be null.")); + } + if (customDomains == null) { + return Mono.error(new IllegalArgumentException("Parameter customDomains is required and cannot be null.")); + } + if (protocols == null) { + return Mono.error(new IllegalArgumentException("Parameter protocols is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted + = metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List groupByConverted = (groupBy == null) + ? new ArrayList<>() + : groupBy.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List continentsConverted = (continents == null) + ? new ArrayList<>() + : continents.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List countryOrRegionsConverted = (countryOrRegions == null) + ? new ArrayList<>() + : countryOrRegions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List customDomainsConverted + = customDomains.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List protocolsConverted + = protocols.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext(context -> service.getLogAnalyticsMetrics(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), profileName, + metricsConverted, dateTimeBegin, dateTimeEnd, granularity, groupByConverted, continentsConverted, + countryOrRegionsConverted, customDomainsConverted, protocolsConverted, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains The customDomains parameter. + * @param protocols The protocols parameter. + * @param groupBy The groupBy parameter. + * @param continents The continents parameter. + * @param countryOrRegions The countryOrRegions 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 log report for AFD profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsMetricsWithResponseAsync(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, List customDomains, List protocols, + List groupBy, List continents, List countryOrRegions, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (granularity == null) { + return Mono.error(new IllegalArgumentException("Parameter granularity is required and cannot be null.")); + } + if (customDomains == null) { + return Mono.error(new IllegalArgumentException("Parameter customDomains is required and cannot be null.")); + } + if (protocols == null) { + return Mono.error(new IllegalArgumentException("Parameter protocols is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted + = metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List groupByConverted = (groupBy == null) + ? new ArrayList<>() + : groupBy.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List continentsConverted = (continents == null) + ? new ArrayList<>() + : continents.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List countryOrRegionsConverted = (countryOrRegions == null) + ? new ArrayList<>() + : countryOrRegions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List customDomainsConverted + = customDomains.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List protocolsConverted + = protocols.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service.getLogAnalyticsMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, metricsConverted, dateTimeBegin, dateTimeEnd, + granularity, groupByConverted, continentsConverted, countryOrRegionsConverted, customDomainsConverted, + protocolsConverted, accept, context); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains The customDomains parameter. + * @param protocols The protocols 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 report for AFD profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsMetricsAsync(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, List customDomains, List protocols) { + final List groupBy = null; + final List continents = null; + final List countryOrRegions = null; + return getLogAnalyticsMetricsWithResponseAsync(resourceGroupName, profileName, metrics, dateTimeBegin, + dateTimeEnd, granularity, customDomains, protocols, groupBy, continents, countryOrRegions) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains The customDomains parameter. + * @param protocols The protocols parameter. + * @param groupBy The groupBy parameter. + * @param continents The continents parameter. + * @param countryOrRegions The countryOrRegions 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 log report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsMetricsWithResponse(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, List customDomains, List protocols, + List groupBy, List continents, List countryOrRegions, Context context) { + return getLogAnalyticsMetricsWithResponseAsync(resourceGroupName, profileName, metrics, dateTimeBegin, + dateTimeEnd, granularity, customDomains, protocols, groupBy, continents, countryOrRegions, context).block(); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains The customDomains parameter. + * @param protocols The protocols 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 report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MetricsResponseInner getLogAnalyticsMetrics(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, List customDomains, List protocols) { + final List groupBy = null; + final List continents = null; + final List countryOrRegions = null; + return getLogAnalyticsMetricsWithResponse(resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, + granularity, customDomains, protocols, groupBy, continents, countryOrRegions, Context.NONE).getValue(); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings The rankings parameter. + * @param metrics The metrics parameter. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains The customDomains 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsRankingsWithResponseAsync(String resourceGroupName, + String profileName, List rankings, List metrics, int maxRanking, + OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, List customDomains) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (rankings == null) { + return Mono.error(new IllegalArgumentException("Parameter rankings is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + final String accept = "application/json"; + List rankingsConverted + = rankings.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List metricsConverted + = metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List customDomainsConverted = (customDomains == null) + ? new ArrayList<>() + : customDomains.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext( + context -> service.getLogAnalyticsRankings(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, rankingsConverted, metricsConverted, + maxRanking, dateTimeBegin, dateTimeEnd, customDomainsConverted, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings The rankings parameter. + * @param metrics The metrics parameter. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains The customDomains 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 log analytics ranking report for AFD profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsRankingsWithResponseAsync(String resourceGroupName, + String profileName, List rankings, List metrics, int maxRanking, + OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, List customDomains, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (rankings == null) { + return Mono.error(new IllegalArgumentException("Parameter rankings is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + final String accept = "application/json"; + List rankingsConverted + = rankings.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List metricsConverted + = metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List customDomainsConverted = (customDomains == null) + ? new ArrayList<>() + : customDomains.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service.getLogAnalyticsRankings(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, rankingsConverted, metricsConverted, + maxRanking, dateTimeBegin, dateTimeEnd, customDomainsConverted, accept, context); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings The rankings parameter. + * @param metrics The metrics parameter. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsRankingsAsync(String resourceGroupName, String profileName, + List rankings, List metrics, int maxRanking, OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd) { + final List customDomains = null; + return getLogAnalyticsRankingsWithResponseAsync(resourceGroupName, profileName, rankings, metrics, maxRanking, + dateTimeBegin, dateTimeEnd, customDomains).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings The rankings parameter. + * @param metrics The metrics parameter. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains The customDomains 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 log analytics ranking report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsRankingsWithResponse(String resourceGroupName, + String profileName, List rankings, List metrics, int maxRanking, + OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, List customDomains, Context context) { + return getLogAnalyticsRankingsWithResponseAsync(resourceGroupName, profileName, rankings, metrics, maxRanking, + dateTimeBegin, dateTimeEnd, customDomains, context).block(); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings The rankings parameter. + * @param metrics The metrics parameter. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RankingsResponseInner getLogAnalyticsRankings(String resourceGroupName, String profileName, + List rankings, List metrics, int maxRanking, OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd) { + final List customDomains = null; + return getLogAnalyticsRankingsWithResponse(resourceGroupName, profileName, rankings, metrics, maxRanking, + dateTimeBegin, dateTimeEnd, customDomains, Context.NONE).getValue(); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsLocationsWithResponseAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getLogAnalyticsLocations(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsLocationsWithResponseAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getLogAnalyticsLocations(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, accept, context); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsLocationsAsync(String resourceGroupName, String profileName) { + return getLogAnalyticsLocationsWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsLocationsWithResponse(String resourceGroupName, + String profileName, Context context) { + return getLogAnalyticsLocationsWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContinentsResponseInner getLogAnalyticsLocations(String resourceGroupName, String profileName) { + return getLogAnalyticsLocationsWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsResourcesWithResponseAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getLogAnalyticsResources(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsResourcesWithResponseAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getLogAnalyticsResources(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, accept, context); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsResourcesAsync(String resourceGroupName, String profileName) { + return getLogAnalyticsResourcesWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsResourcesWithResponse(String resourceGroupName, + String profileName, Context context) { + return getLogAnalyticsResourcesWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourcesResponseInner getLogAnalyticsResources(String resourceGroupName, String profileName) { + return getLogAnalyticsResourcesWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions The actions parameter. + * @param groupBy The groupBy parameter. + * @param ruleTypes The ruleTypes 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWafLogAnalyticsMetricsWithResponseAsync(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + WafGranularity granularity, List actions, List groupBy, + List ruleTypes) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (granularity == null) { + return Mono.error(new IllegalArgumentException("Parameter granularity is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted + = metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List actionsConverted = (actions == null) + ? new ArrayList<>() + : actions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List groupByConverted = (groupBy == null) + ? new ArrayList<>() + : groupBy.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List ruleTypesConverted = (ruleTypes == null) + ? new ArrayList<>() + : ruleTypes.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext( + context -> service.getWafLogAnalyticsMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, metricsConverted, dateTimeBegin, + dateTimeEnd, granularity, actionsConverted, groupByConverted, ruleTypesConverted, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions The actions parameter. + * @param groupBy The groupBy parameter. + * @param ruleTypes The ruleTypes 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 waf related log analytics report for AFD profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWafLogAnalyticsMetricsWithResponseAsync(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + WafGranularity granularity, List actions, List groupBy, + List ruleTypes, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (granularity == null) { + return Mono.error(new IllegalArgumentException("Parameter granularity is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted + = metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List actionsConverted = (actions == null) + ? new ArrayList<>() + : actions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List groupByConverted = (groupBy == null) + ? new ArrayList<>() + : groupBy.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List ruleTypesConverted = (ruleTypes == null) + ? new ArrayList<>() + : ruleTypes.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service.getWafLogAnalyticsMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, metricsConverted, dateTimeBegin, dateTimeEnd, + granularity, actionsConverted, groupByConverted, ruleTypesConverted, accept, context); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWafLogAnalyticsMetricsAsync(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, WafGranularity granularity) { + final List actions = null; + final List groupBy = null; + final List ruleTypes = null; + return getWafLogAnalyticsMetricsWithResponseAsync(resourceGroupName, profileName, metrics, dateTimeBegin, + dateTimeEnd, granularity, actions, groupBy, ruleTypes).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions The actions parameter. + * @param groupBy The groupBy parameter. + * @param ruleTypes The ruleTypes 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 waf related log analytics report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWafLogAnalyticsMetricsWithResponse(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + WafGranularity granularity, List actions, List groupBy, + List ruleTypes, Context context) { + return getWafLogAnalyticsMetricsWithResponseAsync(resourceGroupName, profileName, metrics, dateTimeBegin, + dateTimeEnd, granularity, actions, groupBy, ruleTypes, context).block(); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WafMetricsResponseInner getWafLogAnalyticsMetrics(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, WafGranularity granularity) { + final List actions = null; + final List groupBy = null; + final List ruleTypes = null; + return getWafLogAnalyticsMetricsWithResponse(resourceGroupName, profileName, metrics, dateTimeBegin, + dateTimeEnd, granularity, actions, groupBy, ruleTypes, Context.NONE).getValue(); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings The rankings parameter. + * @param actions The actions parameter. + * @param ruleTypes The ruleTypes 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 log analytics charts for AFD profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWafLogAnalyticsRankingsWithResponseAsync( + String resourceGroupName, String profileName, List metrics, OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, int maxRanking, List rankings, List actions, + List ruleTypes) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (rankings == null) { + return Mono.error(new IllegalArgumentException("Parameter rankings is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted + = metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List rankingsConverted + = rankings.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List actionsConverted = (actions == null) + ? new ArrayList<>() + : actions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List ruleTypesConverted = (ruleTypes == null) + ? new ArrayList<>() + : ruleTypes.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext(context -> service.getWafLogAnalyticsRankings(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), profileName, + metricsConverted, dateTimeBegin, dateTimeEnd, maxRanking, rankingsConverted, actionsConverted, + ruleTypesConverted, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings The rankings parameter. + * @param actions The actions parameter. + * @param ruleTypes The ruleTypes 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 wAF log analytics charts for AFD profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWafLogAnalyticsRankingsWithResponseAsync( + String resourceGroupName, String profileName, List metrics, OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, int maxRanking, List rankings, List actions, + List ruleTypes, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (rankings == null) { + return Mono.error(new IllegalArgumentException("Parameter rankings is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted + = metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List rankingsConverted + = rankings.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List actionsConverted = (actions == null) + ? new ArrayList<>() + : actions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List ruleTypesConverted = (ruleTypes == null) + ? new ArrayList<>() + : ruleTypes.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service.getWafLogAnalyticsRankings(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), profileName, metricsConverted, dateTimeBegin, dateTimeEnd, + maxRanking, rankingsConverted, actionsConverted, ruleTypesConverted, accept, context); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings The rankings 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 log analytics charts for AFD profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWafLogAnalyticsRankingsAsync(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, int maxRanking, + List rankings) { + final List actions = null; + final List ruleTypes = null; + return getWafLogAnalyticsRankingsWithResponseAsync(resourceGroupName, profileName, metrics, dateTimeBegin, + dateTimeEnd, maxRanking, rankings, actions, ruleTypes).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings The rankings parameter. + * @param actions The actions parameter. + * @param ruleTypes The ruleTypes 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 wAF log analytics charts for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWafLogAnalyticsRankingsWithResponse(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + int maxRanking, List rankings, List actions, List ruleTypes, + Context context) { + return getWafLogAnalyticsRankingsWithResponseAsync(resourceGroupName, profileName, metrics, dateTimeBegin, + dateTimeEnd, maxRanking, rankings, actions, ruleTypes, context).block(); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings The rankings 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 log analytics charts for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WafRankingsResponseInner getWafLogAnalyticsRankings(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, int maxRanking, + List rankings) { + final List actions = null; + final List ruleTypes = null; + return getWafLogAnalyticsRankingsWithResponse(resourceGroupName, profileName, metrics, dateTimeBegin, + dateTimeEnd, maxRanking, rankings, actions, ruleTypes, Context.NONE).getValue(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsImpl.java new file mode 100644 index 000000000000..96d109018f9c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ContinentsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponse; +import com.azure.resourcemanager.cdn.generated.models.LogAnalytics; +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.RankingsResponse; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponse; +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.WafRankingGroupBy; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import com.azure.resourcemanager.cdn.generated.models.WafRankingsResponse; +import com.azure.resourcemanager.cdn.generated.models.WafRuleType; +import java.time.OffsetDateTime; +import java.util.List; + +public final class LogAnalyticsImpl implements LogAnalytics { + private static final ClientLogger LOGGER = new ClientLogger(LogAnalyticsImpl.class); + + private final LogAnalyticsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public LogAnalyticsImpl(LogAnalyticsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getLogAnalyticsMetricsWithResponse(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, List customDomains, List protocols, + List groupBy, List continents, List countryOrRegions, Context context) { + Response inner = this.serviceClient() + .getLogAnalyticsMetricsWithResponse(resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, + granularity, customDomains, protocols, groupBy, continents, countryOrRegions, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MetricsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MetricsResponse getLogAnalyticsMetrics(String resourceGroupName, String profileName, List metrics, + OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, LogMetricsGranularity granularity, + List customDomains, List protocols) { + MetricsResponseInner inner = this.serviceClient() + .getLogAnalyticsMetrics(resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, granularity, + customDomains, protocols); + if (inner != null) { + return new MetricsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLogAnalyticsRankingsWithResponse(String resourceGroupName, String profileName, + List rankings, List metrics, int maxRanking, OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, List customDomains, Context context) { + Response inner = this.serviceClient() + .getLogAnalyticsRankingsWithResponse(resourceGroupName, profileName, rankings, metrics, maxRanking, + dateTimeBegin, dateTimeEnd, customDomains, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RankingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RankingsResponse getLogAnalyticsRankings(String resourceGroupName, String profileName, + List rankings, List metrics, int maxRanking, OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd) { + RankingsResponseInner inner = this.serviceClient() + .getLogAnalyticsRankings(resourceGroupName, profileName, rankings, metrics, maxRanking, dateTimeBegin, + dateTimeEnd); + if (inner != null) { + return new RankingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLogAnalyticsLocationsWithResponse(String resourceGroupName, + String profileName, Context context) { + Response inner + = this.serviceClient().getLogAnalyticsLocationsWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContinentsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContinentsResponse getLogAnalyticsLocations(String resourceGroupName, String profileName) { + ContinentsResponseInner inner = this.serviceClient().getLogAnalyticsLocations(resourceGroupName, profileName); + if (inner != null) { + return new ContinentsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLogAnalyticsResourcesWithResponse(String resourceGroupName, + String profileName, Context context) { + Response inner + = this.serviceClient().getLogAnalyticsResourcesWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ResourcesResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ResourcesResponse getLogAnalyticsResources(String resourceGroupName, String profileName) { + ResourcesResponseInner inner = this.serviceClient().getLogAnalyticsResources(resourceGroupName, profileName); + if (inner != null) { + return new ResourcesResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWafLogAnalyticsMetricsWithResponse(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + WafGranularity granularity, List actions, List groupBy, + List ruleTypes, Context context) { + Response inner = this.serviceClient() + .getWafLogAnalyticsMetricsWithResponse(resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, + granularity, actions, groupBy, ruleTypes, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WafMetricsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WafMetricsResponse getWafLogAnalyticsMetrics(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, WafGranularity granularity) { + WafMetricsResponseInner inner = this.serviceClient() + .getWafLogAnalyticsMetrics(resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, + granularity); + if (inner != null) { + return new WafMetricsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWafLogAnalyticsRankingsWithResponse(String resourceGroupName, + String profileName, List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + int maxRanking, List rankings, List actions, List ruleTypes, + Context context) { + Response inner = this.serviceClient() + .getWafLogAnalyticsRankingsWithResponse(resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, + maxRanking, rankings, actions, ruleTypes, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WafRankingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WafRankingsResponse getWafLogAnalyticsRankings(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, int maxRanking, + List rankings) { + WafRankingsResponseInner inner = this.serviceClient() + .getWafLogAnalyticsRankings(resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, maxRanking, + rankings); + if (inner != null) { + return new WafRankingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private LogAnalyticsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetDefinitionImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetDefinitionImpl.java new file mode 100644 index 000000000000..fccdab8bea51 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetDefinitionImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupDefinition; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetDefinition; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import java.util.Collections; +import java.util.List; + +public final class ManagedRuleSetDefinitionImpl implements ManagedRuleSetDefinition { + private ManagedRuleSetDefinitionInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ManagedRuleSetDefinitionImpl(ManagedRuleSetDefinitionInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String ruleSetType() { + return this.innerModel().ruleSetType(); + } + + public String ruleSetVersion() { + return this.innerModel().ruleSetVersion(); + } + + public List ruleGroups() { + List inner = this.innerModel().ruleGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedRuleSetDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsClientImpl.java new file mode 100644 index 000000000000..4f31f8d2567a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsClientImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.ManagedRuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetDefinitionList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagedRuleSetsClient. + */ +public final class ManagedRuleSetsClientImpl implements ManagedRuleSetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedRuleSetsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of ManagedRuleSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedRuleSetsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(ManagedRuleSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientManagedRuleSets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientM") + public interface ManagedRuleSetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/cdnWebApplicationFirewallManagedRuleSets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all available managed rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available managed rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all available managed rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all available managed rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all available managed rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all available managed rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsImpl.java new file mode 100644 index 000000000000..ec1169b17c76 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.ManagedRuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetDefinition; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSets; + +public final class ManagedRuleSetsImpl implements ManagedRuleSets { + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleSetsImpl.class); + + private final ManagedRuleSetsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public ManagedRuleSetsImpl(ManagedRuleSetsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedRuleSetDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedRuleSetDefinitionImpl(inner1, this.manager())); + } + + private ManagedRuleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MetricsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MetricsResponseImpl.java new file mode 100644 index 000000000000..c0e34a90ab3d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MetricsResponseImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.MetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponseSeriesItem; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class MetricsResponseImpl implements MetricsResponse { + private MetricsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + MetricsResponseImpl(MetricsResponseInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public MetricsGranularity granularity() { + return this.innerModel().granularity(); + } + + public List series() { + List inner = this.innerModel().series(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MetricsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MigrateResultImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MigrateResultImpl.java new file mode 100644 index 000000000000..54c44b4cfe31 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MigrateResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner; +import com.azure.resourcemanager.cdn.generated.models.MigrateResult; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +public final class MigrateResultImpl implements MigrateResult { + private MigrateResultInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + MigrateResultImpl(MigrateResultInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public ResourceReference migratedProfileResourceId() { + return this.innerModel().migratedProfileResourceId(); + } + + public MigrateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationImpl.java new file mode 100644 index 000000000000..dd75811e8a54 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.cdn.generated.models.Operation; +import com.azure.resourcemanager.cdn.generated.models.OperationDisplay; +import com.azure.resourcemanager.cdn.generated.models.ServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public ServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..b8e8397913b5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.OperationsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.cdn.generated.models.OperationsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientO") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Cdn/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsImpl.java new file mode 100644 index 000000000000..8794b0079e08 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.OperationsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.cdn.generated.models.Operation; +import com.azure.resourcemanager.cdn.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupImpl.java new file mode 100644 index 000000000000..247fc705cb52 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.OriginGroup; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupResourceState; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.util.Collections; +import java.util.List; + +public final class OriginGroupImpl implements OriginGroup, OriginGroup.Definition, OriginGroup.Update { + private OriginGroupInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OriginGroupResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public OriginGroupProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HealthProbeParameters healthProbeSettings() { + return this.innerModel().healthProbeSettings(); + } + + public List origins() { + List inner = this.innerModel().origins(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerModel().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.innerModel().responseBasedOriginErrorDetectionSettings(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OriginGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private String originGroupName; + + private OriginGroupUpdateParameters updateOriginGroupUpdateProperties; + + public OriginGroupImpl withExistingEndpoint(String resourceGroupName, String profileName, String endpointName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.endpointName = endpointName; + return this; + } + + public OriginGroup create() { + this.innerObject = serviceManager.serviceClient() + .getOriginGroups() + .create(resourceGroupName, profileName, endpointName, originGroupName, this.innerModel(), Context.NONE); + return this; + } + + public OriginGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOriginGroups() + .create(resourceGroupName, profileName, endpointName, originGroupName, this.innerModel(), context); + return this; + } + + OriginGroupImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new OriginGroupInner(); + this.serviceManager = serviceManager; + this.originGroupName = name; + } + + public OriginGroupImpl update() { + this.updateOriginGroupUpdateProperties = new OriginGroupUpdateParameters(); + return this; + } + + public OriginGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getOriginGroups() + .update(resourceGroupName, profileName, endpointName, originGroupName, updateOriginGroupUpdateProperties, + Context.NONE); + return this; + } + + public OriginGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOriginGroups() + .update(resourceGroupName, profileName, endpointName, originGroupName, updateOriginGroupUpdateProperties, + context); + return this; + } + + OriginGroupImpl(OriginGroupInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "endpoints"); + this.originGroupName = ResourceManagerUtils.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 000000000000..b0d026fbdc4b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsClientImpl.java @@ -0,0 +1,1309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.OriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupListResult; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OriginGroupsClient. + */ +public final class OriginGroupsClientImpl implements OriginGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OriginGroupsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of OriginGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OriginGroupsClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(OriginGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientOriginGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientO") + public interface OriginGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpoint(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OriginGroupInner originGroup, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OriginGroupUpdateParameters originGroupUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync(String resourceGroupName, + String profileName, String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEndpoint(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync(String resourceGroupName, + String profileName, String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByEndpoint(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync(String resourceGroupName, String profileName, + String endpointName) { + return new PagedFlux<>(() -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listByEndpointNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listByEndpointNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, + String endpointName) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, + String endpointName, Context context) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + originGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName, + String originGroupName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String originGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName, context).block(); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner get(String resourceGroupName, String profileName, String endpointName, + String originGroupName) { + return getWithResponse(resourceGroupName, profileName, endpointName, originGroupName, Context.NONE).getValue(); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName, OriginGroupInner originGroup) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter originGroup is required and cannot be null.")); + } else { + originGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, originGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), + originGroup, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName, OriginGroupInner originGroup, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter originGroup is required and cannot be null.")); + } else { + originGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), originGroup, accept, context); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginGroupInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, String originGroupName, OriginGroupInner originGroup) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OriginGroupInner.class, OriginGroupInner.class, this.client.getContext()); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginGroupInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, String originGroupName, OriginGroupInner originGroup, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceGroupName, profileName, endpointName, + originGroupName, originGroup, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OriginGroupInner.class, OriginGroupInner.class, context); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginGroupInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, String originGroupName, OriginGroupInner originGroup) { + return this.beginCreateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup) + .getSyncPoller(); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginGroupInner> beginCreate(String resourceGroupName, + String profileName, String endpointName, String originGroupName, OriginGroupInner originGroup, + Context context) { + return this + .beginCreateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup, context) + .getSyncPoller(); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + String originGroupName, OriginGroupInner originGroup) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + String originGroupName, OriginGroupInner originGroup, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner create(String resourceGroupName, String profileName, String endpointName, + String originGroupName, OriginGroupInner originGroup) { + return createAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup).block(); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner create(String resourceGroupName, String profileName, String endpointName, + String originGroupName, OriginGroupInner originGroup, Context context) { + return createAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup, context).block(); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName, OriginGroupUpdateParameters originGroupUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originGroupUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter originGroupUpdateProperties is required and cannot be null.")); + } else { + originGroupUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, originGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), + originGroupUpdateProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName, OriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originGroupUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter originGroupUpdateProperties is required and cannot be null.")); + } else { + originGroupUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), originGroupUpdateProperties, accept, context); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginGroupInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, endpointName, + originGroupName, originGroupUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OriginGroupInner.class, OriginGroupInner.class, this.client.getContext()); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginGroupInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, endpointName, + originGroupName, originGroupUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OriginGroupInner.class, OriginGroupInner.class, context); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginGroupInner> beginUpdate(String resourceGroupName, + String profileName, String endpointName, String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties) { + return this + .beginUpdateAsync(resourceGroupName, profileName, endpointName, originGroupName, + originGroupUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginGroupInner> beginUpdate(String resourceGroupName, + String profileName, String endpointName, String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, Context context) { + return this + .beginUpdateAsync(resourceGroupName, profileName, endpointName, originGroupName, + originGroupUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + String originGroupName, OriginGroupUpdateParameters originGroupUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, originGroupName, + originGroupUpdateProperties).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + String originGroupName, OriginGroupUpdateParameters originGroupUpdateProperties, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, originGroupName, + originGroupUpdateProperties, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner update(String resourceGroupName, String profileName, String endpointName, + String originGroupName, OriginGroupUpdateParameters originGroupUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties) + .block(); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner update(String resourceGroupName, String profileName, String endpointName, + String originGroupName, OriginGroupUpdateParameters originGroupUpdateProperties, Context context) { + return updateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties, + context).block(); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + originGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, originGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName, String originGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName, String originGroupName) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, originGroupName).getSyncPoller(); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName, String originGroupName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, originGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, + String originGroupName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, + String originGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originGroupName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName, String originGroupName) { + deleteAsync(resourceGroupName, profileName, endpointName, originGroupName).block(); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName, String originGroupName, + Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, originGroupName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEndpointNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByEndpointNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsImpl.java new file mode 100644 index 000000000000..27dff0713aa1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.OriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.OriginGroup; +import com.azure.resourcemanager.cdn.generated.models.OriginGroups; + +public final class OriginGroupsImpl implements OriginGroups { + private static final ClientLogger LOGGER = new ClientLogger(OriginGroupsImpl.class); + + private final OriginGroupsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public OriginGroupsImpl(OriginGroupsClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, + String endpointName) { + PagedIterable inner + = this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OriginGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context) { + PagedIterable inner + = this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OriginGroupImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String originGroupName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, profileName, endpointName, originGroupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OriginGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OriginGroup get(String resourceGroupName, String profileName, String endpointName, String originGroupName) { + OriginGroupInner inner + = this.serviceClient().get(resourceGroupName, profileName, endpointName, originGroupName); + if (inner != null) { + return new OriginGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName, String originGroupName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, originGroupName); + } + + public void delete(String resourceGroupName, String profileName, String endpointName, String originGroupName, + Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, originGroupName, context); + } + + public OriginGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, originGroupName, context); + } + + private OriginGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public OriginGroupImpl define(String name) { + return new OriginGroupImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginImpl.java new file mode 100644 index 000000000000..466a8ed667ab --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.azure.resourcemanager.cdn.generated.models.Origin; +import com.azure.resourcemanager.cdn.generated.models.OriginProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginResourceState; +import com.azure.resourcemanager.cdn.generated.models.OriginUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; + +public final class OriginImpl implements Origin, Origin.Definition, Origin.Update { + private OriginInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OriginResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public OriginProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointStatus privateEndpointStatus() { + return this.innerModel().privateEndpointStatus(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Integer httpPort() { + return this.innerModel().httpPort(); + } + + public Integer httpsPort() { + return this.innerModel().httpsPort(); + } + + public String originHostHeader() { + return this.innerModel().originHostHeader(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public Integer weight() { + return this.innerModel().weight(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public String privateLinkAlias() { + return this.innerModel().privateLinkAlias(); + } + + public String privateLinkResourceId() { + return this.innerModel().privateLinkResourceId(); + } + + public String privateLinkLocation() { + return this.innerModel().privateLinkLocation(); + } + + public String privateLinkApprovalMessage() { + return this.innerModel().privateLinkApprovalMessage(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OriginInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private String originName; + + private OriginUpdateParameters updateOriginUpdateProperties; + + public OriginImpl withExistingEndpoint(String resourceGroupName, String profileName, String endpointName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.endpointName = endpointName; + return this; + } + + public Origin create() { + this.innerObject = serviceManager.serviceClient() + .getOrigins() + .create(resourceGroupName, profileName, endpointName, originName, this.innerModel(), Context.NONE); + return this; + } + + public Origin create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrigins() + .create(resourceGroupName, profileName, endpointName, originName, this.innerModel(), context); + return this; + } + + OriginImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new OriginInner(); + this.serviceManager = serviceManager; + this.originName = name; + } + + public OriginImpl update() { + this.updateOriginUpdateProperties = new OriginUpdateParameters(); + return this; + } + + public Origin apply() { + this.innerObject = serviceManager.serviceClient() + .getOrigins() + .update(resourceGroupName, profileName, endpointName, originName, updateOriginUpdateProperties, + Context.NONE); + return this; + } + + public Origin apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrigins() + .update(resourceGroupName, profileName, endpointName, originName, updateOriginUpdateProperties, context); + return this; + } + + OriginImpl(OriginInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "endpoints"); + this.originName = ResourceManagerUtils.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 000000000000..edb819c6929d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsClientImpl.java @@ -0,0 +1,1268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.OriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.azure.resourcemanager.cdn.generated.models.OriginListResult; +import com.azure.resourcemanager.cdn.generated.models.OriginUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OriginsClient. + */ +public final class OriginsClientImpl implements OriginsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OriginsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of OriginsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OriginsClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(OriginsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientOrigins to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientO") + public interface OriginsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpoint(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OriginInner origin, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OriginUpdateParameters originUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync(String resourceGroupName, String profileName, + String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEndpoint(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByEndpoint(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync(String resourceGroupName, String profileName, + String endpointName) { + return new PagedFlux<>(() -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listByEndpointNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listByEndpointNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, + String endpointName) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + originName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, originName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName, + String originName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String originName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originName, context).block(); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner get(String resourceGroupName, String profileName, String endpointName, String originName) { + return getWithResponse(resourceGroupName, profileName, endpointName, originName, Context.NONE).getValue(); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originName, OriginInner origin) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (origin == null) { + return Mono.error(new IllegalArgumentException("Parameter origin is required and cannot be null.")); + } else { + origin.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + originName, this.client.getSubscriptionId(), this.client.getApiVersion(), origin, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originName, OriginInner origin, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (origin == null) { + return Mono.error(new IllegalArgumentException("Parameter origin is required and cannot be null.")); + } else { + origin.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, originName, + this.client.getSubscriptionId(), this.client.getApiVersion(), origin, accept, context); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, String originName, OriginInner origin) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, endpointName, originName, origin); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OriginInner.class, OriginInner.class, this.client.getContext()); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, String originName, OriginInner origin, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, endpointName, originName, origin, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OriginInner.class, OriginInner.class, context); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String originName, OriginInner origin) { + return this.beginCreateAsync(resourceGroupName, profileName, endpointName, originName, origin).getSyncPoller(); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String originName, OriginInner origin, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, endpointName, originName, origin, context) + .getSyncPoller(); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + String originName, OriginInner origin) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originName, origin).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + String originName, OriginInner origin, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originName, origin, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner create(String resourceGroupName, String profileName, String endpointName, String originName, + OriginInner origin) { + return createAsync(resourceGroupName, profileName, endpointName, originName, origin).block(); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner create(String resourceGroupName, String profileName, String endpointName, String originName, + OriginInner origin, Context context) { + return createAsync(resourceGroupName, profileName, endpointName, originName, origin, context).block(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originName, OriginUpdateParameters originUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null.")); + } else { + originUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, originName, this.client.getSubscriptionId(), this.client.getApiVersion(), + originUpdateProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originName, OriginUpdateParameters originUpdateProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (originUpdateProperties == null) { + return Mono.error( + new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null.")); + } else { + originUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, originName, + this.client.getSubscriptionId(), this.client.getApiVersion(), originUpdateProperties, accept, context); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OriginInner.class, OriginInner.class, this.client.getContext()); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, endpointName, + originName, originUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OriginInner.class, OriginInner.class, context); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String originName, OriginUpdateParameters originUpdateProperties) { + return this.beginUpdateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String originName, OriginUpdateParameters originUpdateProperties, Context context) { + return this + .beginUpdateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + String originName, OriginUpdateParameters originUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + String originName, OriginUpdateParameters originUpdateProperties, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner update(String resourceGroupName, String profileName, String endpointName, String originName, + OriginUpdateParameters originUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties).block(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner update(String resourceGroupName, String profileName, String endpointName, String originName, + OriginUpdateParameters originUpdateProperties, Context context) { + return updateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + originName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String originName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, originName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName, String originName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, originName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName, String originName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, originName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName, String originName) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, originName).getSyncPoller(); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName, String originName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, originName, context).getSyncPoller(); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, + String originName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, String originName, + Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName, String originName) { + deleteAsync(resourceGroupName, profileName, endpointName, originName).block(); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName, String originName, + Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, originName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEndpointNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByEndpointNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsImpl.java new file mode 100644 index 000000000000..296b03e277ce --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.OriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.azure.resourcemanager.cdn.generated.models.Origin; +import com.azure.resourcemanager.cdn.generated.models.Origins; + +public final class OriginsImpl implements Origins { + private static final ClientLogger LOGGER = new ClientLogger(OriginsImpl.class); + + private final OriginsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public OriginsImpl(OriginsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner + = this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OriginImpl(inner1, this.manager())); + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context) { + PagedIterable inner + = this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OriginImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String originName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, endpointName, originName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OriginImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Origin get(String resourceGroupName, String profileName, String endpointName, String originName) { + OriginInner inner = this.serviceClient().get(resourceGroupName, profileName, endpointName, originName); + if (inner != null) { + return new OriginImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName, String originName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, originName); + } + + public void delete(String resourceGroupName, String profileName, String endpointName, String originName, + Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, originName, context); + } + + public Origin getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, originName, context); + } + + private OriginsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public OriginImpl define(String name) { + return new OriginImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesClientImpl.java new file mode 100644 index 000000000000..636016304664 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesClientImpl.java @@ -0,0 +1,1059 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.PoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicyList; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicyPatchParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PoliciesClient. + */ +public final class PoliciesClientImpl implements PoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final PoliciesService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of PoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PoliciesClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(PoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientPolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientP") + public interface PoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String policyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, policyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String policyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, policyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String policyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String policyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName, context).block(); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName) { + return getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE).getValue(); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String policyName, CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (cdnWebApplicationFirewallPolicy == null) { + return Mono.error(new IllegalArgumentException( + "Parameter cdnWebApplicationFirewallPolicy is required and cannot be null.")); + } else { + cdnWebApplicationFirewallPolicy.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, policyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), cdnWebApplicationFirewallPolicy, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String policyName, CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (cdnWebApplicationFirewallPolicy == null) { + return Mono.error(new IllegalArgumentException( + "Parameter cdnWebApplicationFirewallPolicy is required and cannot be null.")); + } else { + cdnWebApplicationFirewallPolicy.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, policyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), cdnWebApplicationFirewallPolicy, accept, + context); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdateAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), CdnWebApplicationFirewallPolicyInner.class, + CdnWebApplicationFirewallPolicyInner.class, this.client.getContext()); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdateAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), CdnWebApplicationFirewallPolicyInner.class, + CdnWebApplicationFirewallPolicyInner.class, context); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + return this.beginCreateOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy) + .getSyncPoller(); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, context) + .getSyncPoller(); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner createOrUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + return createOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy).block(); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner createOrUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, Context context) { + return createOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, context).block(); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (cdnWebApplicationFirewallPolicyPatchParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter cdnWebApplicationFirewallPolicyPatchParameters is required and cannot be null.")); + } else { + cdnWebApplicationFirewallPolicyPatchParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, policyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), + cdnWebApplicationFirewallPolicyPatchParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (cdnWebApplicationFirewallPolicyPatchParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter cdnWebApplicationFirewallPolicyPatchParameters is required and cannot be null.")); + } else { + cdnWebApplicationFirewallPolicyPatchParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, policyName, this.client.getSubscriptionId(), + this.client.getApiVersion(), cdnWebApplicationFirewallPolicyPatchParameters, accept, context); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CdnWebApplicationFirewallPolicyInner> + beginUpdateAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), CdnWebApplicationFirewallPolicyInner.class, + CdnWebApplicationFirewallPolicyInner.class, this.client.getContext()); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CdnWebApplicationFirewallPolicyInner> + beginUpdateAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, policyName, + cdnWebApplicationFirewallPolicyPatchParameters, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), CdnWebApplicationFirewallPolicyInner.class, + CdnWebApplicationFirewallPolicyInner.class, context); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + return this.beginUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters) + .getSyncPoller(); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginUpdate(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters, context) + .getSyncPoller(); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + return beginUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner update(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + return updateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters).block(); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner update(String resourceGroupName, String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context) { + return updateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters, context) + .block(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String policyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, policyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String policyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, policyName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String policyName) { + return deleteWithResponseAsync(resourceGroupName, policyName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String policyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, policyName, context).block(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String policyName) { + deleteWithResponse(resourceGroupName, policyName, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesImpl.java new file mode 100644 index 000000000000..d4a78da49bbe --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.PoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicy; +import com.azure.resourcemanager.cdn.generated.models.Policies; + +public final class PoliciesImpl implements Policies { + private static final ClientLogger LOGGER = new ClientLogger(PoliciesImpl.class); + + private final PoliciesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public PoliciesImpl(PoliciesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CdnWebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CdnWebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String policyName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, policyName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CdnWebApplicationFirewallPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CdnWebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName) { + CdnWebApplicationFirewallPolicyInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, policyName); + if (inner != null) { + return new CdnWebApplicationFirewallPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String policyName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, policyName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String policyName) { + this.serviceClient().delete(resourceGroupName, policyName); + } + + public CdnWebApplicationFirewallPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = ResourceManagerUtils.getValueFromIdByName(id, "cdnWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'cdnWebApplicationFirewallPolicies'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = ResourceManagerUtils.getValueFromIdByName(id, "cdnWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'cdnWebApplicationFirewallPolicies'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, policyName, context); + } + + private PoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public CdnWebApplicationFirewallPolicyImpl define(String name) { + return new CdnWebApplicationFirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfileImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfileImpl.java new file mode 100644 index 000000000000..dc40107d2a74 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfileImpl.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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateResult; +import com.azure.resourcemanager.cdn.generated.models.CdnMigrationToAfdParameters; +import com.azure.resourcemanager.cdn.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cdn.generated.models.MigrateResult; +import com.azure.resourcemanager.cdn.generated.models.Profile; +import com.azure.resourcemanager.cdn.generated.models.ProfileLogScrubbing; +import com.azure.resourcemanager.cdn.generated.models.ProfileProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.ProfileResourceState; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SsoUri; +import com.azure.resourcemanager.cdn.generated.models.SupportedOptimizationTypesListResult; +import java.util.Collections; +import java.util.Map; + +public final class ProfileImpl implements Profile, Profile.Definition, Profile.Update { + private ProfileInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProfileResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public ProfileProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Map extendedProperties() { + Map inner = this.innerModel().extendedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String frontDoorId() { + return this.innerModel().frontDoorId(); + } + + public Integer originResponseTimeoutSeconds() { + return this.innerModel().originResponseTimeoutSeconds(); + } + + public ProfileLogScrubbing logScrubbing() { + return this.innerModel().logScrubbing(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private ProfileUpdateParameters updateProfileUpdateParameters; + + public ProfileImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Profile create() { + this.innerObject = serviceManager.serviceClient() + .getProfiles() + .create(resourceGroupName, profileName, this.innerModel(), Context.NONE); + return this; + } + + public Profile create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProfiles() + .create(resourceGroupName, profileName, this.innerModel(), context); + return this; + } + + ProfileImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new ProfileInner(); + this.serviceManager = serviceManager; + this.profileName = name; + } + + public ProfileImpl update() { + this.updateProfileUpdateParameters = new ProfileUpdateParameters(); + return this; + } + + public Profile apply() { + this.innerObject = serviceManager.serviceClient() + .getProfiles() + .update(resourceGroupName, profileName, updateProfileUpdateParameters, Context.NONE); + return this; + } + + public Profile apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProfiles() + .update(resourceGroupName, profileName, updateProfileUpdateParameters, context); + return this; + } + + ProfileImpl(ProfileInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + } + + public Profile refresh() { + this.innerObject = serviceManager.serviceClient() + .getProfiles() + .getByResourceGroupWithResponse(resourceGroupName, profileName, Context.NONE) + .getValue(); + return this; + } + + public Profile refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProfiles() + .getByResourceGroupWithResponse(resourceGroupName, profileName, context) + .getValue(); + return this; + } + + public void migrationCommit() { + serviceManager.profiles().migrationCommit(resourceGroupName, profileName); + } + + public void migrationCommit(Context context) { + serviceManager.profiles().migrationCommit(resourceGroupName, profileName, context); + } + + public Response generateSsoUriWithResponse(Context context) { + return serviceManager.profiles().generateSsoUriWithResponse(resourceGroupName, profileName, context); + } + + public SsoUri generateSsoUri() { + return serviceManager.profiles().generateSsoUri(resourceGroupName, profileName); + } + + public Response listSupportedOptimizationTypesWithResponse(Context context) { + return serviceManager.profiles() + .listSupportedOptimizationTypesWithResponse(resourceGroupName, profileName, context); + } + + public SupportedOptimizationTypesListResult listSupportedOptimizationTypes() { + return serviceManager.profiles().listSupportedOptimizationTypes(resourceGroupName, profileName); + } + + public PagedIterable listResourceUsage() { + return serviceManager.profiles().listResourceUsage(resourceGroupName, profileName); + } + + public PagedIterable listResourceUsage(Context context) { + return serviceManager.profiles().listResourceUsage(resourceGroupName, profileName, context); + } + + public CanMigrateResult cdnCanMigrateToAfd() { + return serviceManager.profiles().cdnCanMigrateToAfd(resourceGroupName, profileName); + } + + public CanMigrateResult cdnCanMigrateToAfd(Context context) { + return serviceManager.profiles().cdnCanMigrateToAfd(resourceGroupName, profileName, context); + } + + public MigrateResult cdnMigrateToAfd(CdnMigrationToAfdParameters migrationParameters) { + return serviceManager.profiles().cdnMigrateToAfd(resourceGroupName, profileName, migrationParameters); + } + + public MigrateResult cdnMigrateToAfd(CdnMigrationToAfdParameters migrationParameters, Context context) { + return serviceManager.profiles().cdnMigrateToAfd(resourceGroupName, profileName, migrationParameters, context); + } + + public void migrationAbort() { + serviceManager.profiles().migrationAbort(resourceGroupName, profileName); + } + + public void migrationAbort(Context context) { + serviceManager.profiles().migrationAbort(resourceGroupName, profileName, context); + } + + public ProfileImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ProfileImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ProfileImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ProfileImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProfileUpdateParameters.withTags(tags); + return this; + } + } + + public ProfileImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProfileUpdateParameters.withIdentity(identity); + return this; + } + } + + public ProfileImpl withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + if (isInCreateMode()) { + this.innerModel().withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } else { + this.updateProfileUpdateParameters.withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } + } + + public ProfileImpl withLogScrubbing(ProfileLogScrubbing logScrubbing) { + if (isInCreateMode()) { + this.innerModel().withLogScrubbing(logScrubbing); + return this; + } else { + this.updateProfileUpdateParameters.withLogScrubbing(logScrubbing); + 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 000000000000..c3abe7de1dd8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesClientImpl.java @@ -0,0 +1,3272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.ProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.CdnMigrationToAfdParameters; +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.ProfileListResult; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProfilesClient. + */ +public final class ProfilesClientImpl implements ProfilesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProfilesService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of ProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProfilesClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(ProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientProfiles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientP") + public interface ProfilesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProfileInner profile, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProfileUpdateParameters profileUpdateParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/canMigrate") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> canMigrate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CanMigrateParameters canMigrateParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/migrate") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationParameters migrationParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/migrationCommit") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrationCommit(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateSsoUri(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getSupportedOptimizationTypes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSupportedOptimizationTypes( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkResourceUsage") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/cdnCanMigrateToAfd") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cdnCanMigrateToAfd(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @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}/cdnMigrateToAfd") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cdnMigrateToAfd(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CdnMigrationToAfdParameters migrationParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/migrationAbort") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrationAbort(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, + profileName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String profileName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String profileName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner getByResourceGroup(String resourceGroupName, String profileName) { + return getByResourceGroupWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + ProfileInner profile) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (profile == null) { + return Mono.error(new IllegalArgumentException("Parameter profile is required and cannot be null.")); + } else { + profile.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), profile, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + ProfileInner profile, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (profile == null) { + return Mono.error(new IllegalArgumentException("Parameter profile is required and cannot be null.")); + } else { + profile.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), profile, accept, context); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginCreateAsync(String resourceGroupName, + String profileName, ProfileInner profile) { + Mono>> mono = createWithResponseAsync(resourceGroupName, profileName, profile); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProfileInner.class, ProfileInner.class, this.client.getContext()); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginCreateAsync(String resourceGroupName, + String profileName, ProfileInner profile, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, profile, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProfileInner.class, ProfileInner.class, context); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginCreate(String resourceGroupName, String profileName, + ProfileInner profile) { + return this.beginCreateAsync(resourceGroupName, profileName, profile).getSyncPoller(); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginCreate(String resourceGroupName, String profileName, + ProfileInner profile, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, profile, context).getSyncPoller(); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, ProfileInner profile) { + return beginCreateAsync(resourceGroupName, profileName, profile).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, ProfileInner profile, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, profile, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile) { + return createAsync(resourceGroupName, profileName, profile).block(); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile, Context context) { + return createAsync(resourceGroupName, profileName, profile, context).block(); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (profileUpdateParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter profileUpdateParameters is required and cannot be null.")); + } else { + profileUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), profileUpdateParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (profileUpdateParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter profileUpdateParameters is required and cannot be null.")); + } else { + profileUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), profileUpdateParameters, accept, context); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginUpdateAsync(String resourceGroupName, + String profileName, ProfileUpdateParameters profileUpdateParameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, profileUpdateParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProfileInner.class, ProfileInner.class, this.client.getContext()); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginUpdateAsync(String resourceGroupName, + String profileName, ProfileUpdateParameters profileUpdateParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, profileUpdateParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProfileInner.class, ProfileInner.class, context); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginUpdate(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters) { + return this.beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters).getSyncPoller(); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginUpdate(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters, context).getSyncPoller(); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters) { + return beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner update(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters) { + return updateAsync(resourceGroupName, profileName, profileUpdateParameters).block(); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner update(String resourceGroupName, String profileName, + ProfileUpdateParameters profileUpdateParameters, Context context) { + return updateAsync(resourceGroupName, profileName, profileUpdateParameters, context).block(); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName) { + return this.beginDeleteAsync(resourceGroupName, profileName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, context).getSyncPoller(); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName) { + return beginDeleteAsync(resourceGroupName, profileName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName) { + deleteAsync(resourceGroupName, profileName).block(); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, Context context) { + deleteAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> canMigrateWithResponseAsync(String resourceGroupName, + CanMigrateParameters canMigrateParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (canMigrateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter canMigrateParameters is required and cannot be null.")); + } else { + canMigrateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.canMigrate(this.client.getEndpoint(), resourceGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), canMigrateParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> canMigrateWithResponseAsync(String resourceGroupName, + CanMigrateParameters canMigrateParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (canMigrateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter canMigrateParameters is required and cannot be null.")); + } else { + canMigrateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.canMigrate(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), + this.client.getApiVersion(), canMigrateParameters, accept, context); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CanMigrateResultInner> + beginCanMigrateAsync(String resourceGroupName, CanMigrateParameters canMigrateParameters) { + Mono>> mono = canMigrateWithResponseAsync(resourceGroupName, canMigrateParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CanMigrateResultInner.class, CanMigrateResultInner.class, + this.client.getContext()); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CanMigrateResultInner> + beginCanMigrateAsync(String resourceGroupName, CanMigrateParameters canMigrateParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = canMigrateWithResponseAsync(resourceGroupName, canMigrateParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CanMigrateResultInner.class, CanMigrateResultInner.class, context); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CanMigrateResultInner> + beginCanMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters) { + return this.beginCanMigrateAsync(resourceGroupName, canMigrateParameters).getSyncPoller(); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CanMigrateResultInner> + beginCanMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters, Context context) { + return this.beginCanMigrateAsync(resourceGroupName, canMigrateParameters, context).getSyncPoller(); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono canMigrateAsync(String resourceGroupName, + CanMigrateParameters canMigrateParameters) { + return beginCanMigrateAsync(resourceGroupName, canMigrateParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono canMigrateAsync(String resourceGroupName, + CanMigrateParameters canMigrateParameters, Context context) { + return beginCanMigrateAsync(resourceGroupName, canMigrateParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CanMigrateResultInner canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters) { + return canMigrateAsync(resourceGroupName, canMigrateParameters).block(); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CanMigrateResultInner canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters, + Context context) { + return canMigrateAsync(resourceGroupName, canMigrateParameters, context).block(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrateWithResponseAsync(String resourceGroupName, + MigrationParameters migrationParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (migrationParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationParameters is required and cannot be null.")); + } else { + migrationParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.migrate(this.client.getEndpoint(), resourceGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), migrationParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrateWithResponseAsync(String resourceGroupName, + MigrationParameters migrationParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (migrationParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationParameters is required and cannot be null.")); + } else { + migrationParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.migrate(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), + this.client.getApiVersion(), migrationParameters, accept, context); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrateResultInner> beginMigrateAsync(String resourceGroupName, + MigrationParameters migrationParameters) { + Mono>> mono = migrateWithResponseAsync(resourceGroupName, migrationParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MigrateResultInner.class, MigrateResultInner.class, this.client.getContext()); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrateResultInner> beginMigrateAsync(String resourceGroupName, + MigrationParameters migrationParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = migrateWithResponseAsync(resourceGroupName, migrationParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MigrateResultInner.class, MigrateResultInner.class, context); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrateResultInner> beginMigrate(String resourceGroupName, + MigrationParameters migrationParameters) { + return this.beginMigrateAsync(resourceGroupName, migrationParameters).getSyncPoller(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrateResultInner> beginMigrate(String resourceGroupName, + MigrationParameters migrationParameters, Context context) { + return this.beginMigrateAsync(resourceGroupName, migrationParameters, context).getSyncPoller(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateAsync(String resourceGroupName, MigrationParameters migrationParameters) { + return beginMigrateAsync(resourceGroupName, migrationParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateAsync(String resourceGroupName, MigrationParameters migrationParameters, + Context context) { + return beginMigrateAsync(resourceGroupName, migrationParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrateResultInner migrate(String resourceGroupName, MigrationParameters migrationParameters) { + return migrateAsync(resourceGroupName, migrationParameters).block(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrateResultInner migrate(String resourceGroupName, MigrationParameters migrationParameters, + Context context) { + return migrateAsync(resourceGroupName, migrationParameters, context).block(); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrationCommitWithResponseAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.migrationCommit(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrationCommitWithResponseAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.migrationCommit(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginMigrationCommitAsync(String resourceGroupName, String profileName) { + Mono>> mono = migrationCommitWithResponseAsync(resourceGroupName, profileName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginMigrationCommitAsync(String resourceGroupName, String profileName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = migrationCommitWithResponseAsync(resourceGroupName, profileName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginMigrationCommit(String resourceGroupName, String profileName) { + return this.beginMigrationCommitAsync(resourceGroupName, profileName).getSyncPoller(); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginMigrationCommit(String resourceGroupName, String profileName, + Context context) { + return this.beginMigrationCommitAsync(resourceGroupName, profileName, context).getSyncPoller(); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrationCommitAsync(String resourceGroupName, String profileName) { + return beginMigrationCommitAsync(resourceGroupName, profileName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrationCommitAsync(String resourceGroupName, String profileName, Context context) { + return beginMigrationCommitAsync(resourceGroupName, profileName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void migrationCommit(String resourceGroupName, String profileName) { + migrationCommitAsync(resourceGroupName, profileName).block(); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void migrationCommit(String resourceGroupName, String profileName, Context context) { + migrationCommitAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateSsoUriWithResponseAsync(String resourceGroupName, String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generateSsoUri(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateSsoUriWithResponseAsync(String resourceGroupName, String profileName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.generateSsoUri(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateSsoUriAsync(String resourceGroupName, String profileName) { + return generateSsoUriWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateSsoUriWithResponse(String resourceGroupName, String profileName, + Context context) { + return generateSsoUriWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsoUriInner generateSsoUri(String resourceGroupName, String profileName) { + return generateSsoUriWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSupportedOptimizationTypesWithResponseAsync(String resourceGroupName, String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSupportedOptimizationTypes(this.client.getEndpoint(), resourceGroupName, + profileName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSupportedOptimizationTypesWithResponseAsync(String resourceGroupName, String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSupportedOptimizationTypes(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + listSupportedOptimizationTypesAsync(String resourceGroupName, String profileName) { + return listSupportedOptimizationTypesWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + listSupportedOptimizationTypesWithResponse(String resourceGroupName, String profileName, Context context) { + return listSupportedOptimizationTypesWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportedOptimizationTypesListResultInner listSupportedOptimizationTypes(String resourceGroupName, + String profileName) { + return listSupportedOptimizationTypesWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>(() -> listResourceUsageSinglePageAsync(resourceGroupName, profileName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + Context context) { + return new PagedFlux<>(() -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, context)); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cdnCanMigrateToAfdWithResponseAsync(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.cdnCanMigrateToAfd(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, profileName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cdnCanMigrateToAfdWithResponseAsync(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.cdnCanMigrateToAfd(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + profileName, this.client.getApiVersion(), accept, context); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CanMigrateResultInner> + beginCdnCanMigrateToAfdAsync(String resourceGroupName, String profileName) { + Mono>> mono = cdnCanMigrateToAfdWithResponseAsync(resourceGroupName, profileName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CanMigrateResultInner.class, CanMigrateResultInner.class, + this.client.getContext()); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CanMigrateResultInner> + beginCdnCanMigrateToAfdAsync(String resourceGroupName, String profileName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = cdnCanMigrateToAfdWithResponseAsync(resourceGroupName, profileName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CanMigrateResultInner.class, CanMigrateResultInner.class, context); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CanMigrateResultInner> + beginCdnCanMigrateToAfd(String resourceGroupName, String profileName) { + return this.beginCdnCanMigrateToAfdAsync(resourceGroupName, profileName).getSyncPoller(); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CanMigrateResultInner> + beginCdnCanMigrateToAfd(String resourceGroupName, String profileName, Context context) { + return this.beginCdnCanMigrateToAfdAsync(resourceGroupName, profileName, context).getSyncPoller(); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cdnCanMigrateToAfdAsync(String resourceGroupName, String profileName) { + return beginCdnCanMigrateToAfdAsync(resourceGroupName, profileName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cdnCanMigrateToAfdAsync(String resourceGroupName, String profileName, + Context context) { + return beginCdnCanMigrateToAfdAsync(resourceGroupName, profileName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CanMigrateResultInner cdnCanMigrateToAfd(String resourceGroupName, String profileName) { + return cdnCanMigrateToAfdAsync(resourceGroupName, profileName).block(); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CanMigrateResultInner cdnCanMigrateToAfd(String resourceGroupName, String profileName, Context context) { + return cdnCanMigrateToAfdAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cdnMigrateToAfdWithResponseAsync(String resourceGroupName, + String profileName, CdnMigrationToAfdParameters migrationParameters) { + 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 (migrationParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationParameters is required and cannot be null.")); + } else { + migrationParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cdnMigrateToAfd(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, profileName, this.client.getApiVersion(), migrationParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cdnMigrateToAfdWithResponseAsync(String resourceGroupName, + String profileName, CdnMigrationToAfdParameters migrationParameters, 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 (migrationParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationParameters is required and cannot be null.")); + } else { + migrationParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.cdnMigrateToAfd(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + profileName, this.client.getApiVersion(), migrationParameters, accept, context); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrateResultInner> beginCdnMigrateToAfdAsync( + String resourceGroupName, String profileName, CdnMigrationToAfdParameters migrationParameters) { + Mono>> mono + = cdnMigrateToAfdWithResponseAsync(resourceGroupName, profileName, migrationParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MigrateResultInner.class, MigrateResultInner.class, this.client.getContext()); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrateResultInner> beginCdnMigrateToAfdAsync( + String resourceGroupName, String profileName, CdnMigrationToAfdParameters migrationParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = cdnMigrateToAfdWithResponseAsync(resourceGroupName, profileName, migrationParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MigrateResultInner.class, MigrateResultInner.class, context); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrateResultInner> beginCdnMigrateToAfd(String resourceGroupName, + String profileName, CdnMigrationToAfdParameters migrationParameters) { + return this.beginCdnMigrateToAfdAsync(resourceGroupName, profileName, migrationParameters).getSyncPoller(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrateResultInner> beginCdnMigrateToAfd(String resourceGroupName, + String profileName, CdnMigrationToAfdParameters migrationParameters, Context context) { + return this.beginCdnMigrateToAfdAsync(resourceGroupName, profileName, migrationParameters, context) + .getSyncPoller(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cdnMigrateToAfdAsync(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters) { + return beginCdnMigrateToAfdAsync(resourceGroupName, profileName, migrationParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cdnMigrateToAfdAsync(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters, Context context) { + return beginCdnMigrateToAfdAsync(resourceGroupName, profileName, migrationParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrateResultInner cdnMigrateToAfd(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters) { + return cdnMigrateToAfdAsync(resourceGroupName, profileName, migrationParameters).block(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrateResultInner cdnMigrateToAfd(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters, Context context) { + return cdnMigrateToAfdAsync(resourceGroupName, profileName, migrationParameters, context).block(); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrationAbortWithResponseAsync(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.migrationAbort(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, profileName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrationAbortWithResponseAsync(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.migrationAbort(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + profileName, this.client.getApiVersion(), accept, context); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginMigrationAbortAsync(String resourceGroupName, String profileName) { + Mono>> mono = migrationAbortWithResponseAsync(resourceGroupName, profileName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginMigrationAbortAsync(String resourceGroupName, String profileName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = migrationAbortWithResponseAsync(resourceGroupName, profileName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginMigrationAbort(String resourceGroupName, String profileName) { + return this.beginMigrationAbortAsync(resourceGroupName, profileName).getSyncPoller(); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginMigrationAbort(String resourceGroupName, String profileName, + Context context) { + return this.beginMigrationAbortAsync(resourceGroupName, profileName, context).getSyncPoller(); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrationAbortAsync(String resourceGroupName, String profileName) { + return beginMigrationAbortAsync(resourceGroupName, profileName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrationAbortAsync(String resourceGroupName, String profileName, Context context) { + return beginMigrationAbortAsync(resourceGroupName, profileName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 migrationAbort(String resourceGroupName, String profileName) { + migrationAbortAsync(resourceGroupName, profileName).block(); + } + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 migrationAbort(String resourceGroupName, String profileName, Context context) { + migrationAbortAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesImpl.java new file mode 100644 index 000000000000..e70eefa91768 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesImpl.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.ProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateResult; +import com.azure.resourcemanager.cdn.generated.models.CdnMigrationToAfdParameters; +import com.azure.resourcemanager.cdn.generated.models.MigrateResult; +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.Profile; +import com.azure.resourcemanager.cdn.generated.models.Profiles; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.SsoUri; +import com.azure.resourcemanager.cdn.generated.models.SupportedOptimizationTypesListResult; + +public final class ProfilesImpl implements Profiles { + private static final ClientLogger LOGGER = new ClientLogger(ProfilesImpl.class); + + private final ProfilesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public ProfilesImpl(ProfilesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String profileName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Profile getByResourceGroup(String resourceGroupName, String profileName) { + ProfileInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, profileName); + if (inner != null) { + return new ProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String profileName) { + this.serviceClient().delete(resourceGroupName, profileName); + } + + public void delete(String resourceGroupName, String profileName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, context); + } + + public CanMigrateResult canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters) { + CanMigrateResultInner inner = this.serviceClient().canMigrate(resourceGroupName, canMigrateParameters); + if (inner != null) { + return new CanMigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public CanMigrateResult canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters, + Context context) { + CanMigrateResultInner inner = this.serviceClient().canMigrate(resourceGroupName, canMigrateParameters, context); + if (inner != null) { + return new CanMigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrateResult migrate(String resourceGroupName, MigrationParameters migrationParameters) { + MigrateResultInner inner = this.serviceClient().migrate(resourceGroupName, migrationParameters); + if (inner != null) { + return new MigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrateResult migrate(String resourceGroupName, MigrationParameters migrationParameters, Context context) { + MigrateResultInner inner = this.serviceClient().migrate(resourceGroupName, migrationParameters, context); + if (inner != null) { + return new MigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void migrationCommit(String resourceGroupName, String profileName) { + this.serviceClient().migrationCommit(resourceGroupName, profileName); + } + + public void migrationCommit(String resourceGroupName, String profileName, Context context) { + this.serviceClient().migrationCommit(resourceGroupName, profileName, context); + } + + public Response generateSsoUriWithResponse(String resourceGroupName, String profileName, Context context) { + Response inner + = this.serviceClient().generateSsoUriWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SsoUriImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SsoUri generateSsoUri(String resourceGroupName, String profileName) { + SsoUriInner inner = this.serviceClient().generateSsoUri(resourceGroupName, profileName); + if (inner != null) { + return new SsoUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response + listSupportedOptimizationTypesWithResponse(String resourceGroupName, String profileName, Context context) { + Response inner + = this.serviceClient().listSupportedOptimizationTypesWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SupportedOptimizationTypesListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SupportedOptimizationTypesListResult listSupportedOptimizationTypes(String resourceGroupName, + String profileName) { + SupportedOptimizationTypesListResultInner inner + = this.serviceClient().listSupportedOptimizationTypes(resourceGroupName, profileName); + if (inner != null) { + return new SupportedOptimizationTypesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + Context context) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public CanMigrateResult cdnCanMigrateToAfd(String resourceGroupName, String profileName) { + CanMigrateResultInner inner = this.serviceClient().cdnCanMigrateToAfd(resourceGroupName, profileName); + if (inner != null) { + return new CanMigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public CanMigrateResult cdnCanMigrateToAfd(String resourceGroupName, String profileName, Context context) { + CanMigrateResultInner inner = this.serviceClient().cdnCanMigrateToAfd(resourceGroupName, profileName, context); + if (inner != null) { + return new CanMigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrateResult cdnMigrateToAfd(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters) { + MigrateResultInner inner + = this.serviceClient().cdnMigrateToAfd(resourceGroupName, profileName, migrationParameters); + if (inner != null) { + return new MigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrateResult cdnMigrateToAfd(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters, Context context) { + MigrateResultInner inner + = this.serviceClient().cdnMigrateToAfd(resourceGroupName, profileName, migrationParameters, context); + if (inner != null) { + return new MigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void migrationAbort(String resourceGroupName, String profileName) { + this.serviceClient().migrationAbort(resourceGroupName, profileName); + } + + public void migrationAbort(String resourceGroupName, String profileName, Context context) { + this.serviceClient().migrationAbort(resourceGroupName, profileName, context); + } + + public Profile getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + this.delete(resourceGroupName, profileName, context); + } + + private ProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public ProfileImpl define(String name) { + return new ProfileImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RankingsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RankingsResponseImpl.java new file mode 100644 index 000000000000..ba2fa5496956 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RankingsResponseImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.RankingsResponse; +import com.azure.resourcemanager.cdn.generated.models.RankingsResponseTablesItem; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class RankingsResponseImpl implements RankingsResponse { + private RankingsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + RankingsResponseImpl(RankingsResponseInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public List tables() { + List inner = this.innerModel().tables(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RankingsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceManagerUtils.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..ec2679d9d035 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/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 000000000000..cf9499cbe953 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,593 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. + */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ResourceProvidersService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientResourceProviders to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + public interface ResourceProvidersService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/checkEndpointNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkEndpointNameAvailability( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Cdn/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailabilityWithSubscription( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateProbe") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateProbe(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ValidateProbeInput validateProbeInput, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEndpointNameAvailabilityWithResponseAsync( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (checkEndpointNameAvailabilityInput == null) { + return Mono.error(new IllegalArgumentException( + "Parameter checkEndpointNameAvailabilityInput is required and cannot be null.")); + } else { + checkEndpointNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkEndpointNameAvailability(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), + checkEndpointNameAvailabilityInput, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEndpointNameAvailabilityWithResponseAsync( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (checkEndpointNameAvailabilityInput == null) { + return Mono.error(new IllegalArgumentException( + "Parameter checkEndpointNameAvailabilityInput is required and cannot be null.")); + } else { + checkEndpointNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkEndpointNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), checkEndpointNameAvailabilityInput, accept, context); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkEndpointNameAvailabilityAsync(String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + return checkEndpointNameAvailabilityWithResponseAsync(resourceGroupName, checkEndpointNameAvailabilityInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + Context context) { + return checkEndpointNameAvailabilityWithResponseAsync(resourceGroupName, checkEndpointNameAvailabilityInput, + context).block(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckEndpointNameAvailabilityOutputInner checkEndpointNameAvailability(String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + return checkEndpointNameAvailabilityWithResponse(resourceGroupName, checkEndpointNameAvailabilityInput, + Context.NONE).getValue(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (checkNameAvailabilityInput == null) { + return Mono.error( + new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); + } else { + checkNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), checkNameAvailabilityInput, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (checkNameAvailabilityInput == null) { + return Mono.error( + new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); + } else { + checkNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + checkNameAvailabilityInput, accept, context); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + checkNameAvailabilityAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput, context).block(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityOutputInner + checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponse(checkNameAvailabilityInput, Context.NONE).getValue(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + checkNameAvailabilityWithSubscriptionWithResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (checkNameAvailabilityInput == null) { + return Mono.error( + new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); + } else { + checkNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.checkNameAvailabilityWithSubscription(this.client.getEndpoint(), + this.client.getSubscriptionId(), this.client.getApiVersion(), checkNameAvailabilityInput, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithSubscriptionWithResponseAsync( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (checkNameAvailabilityInput == null) { + return Mono.error( + new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); + } else { + checkNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkNameAvailabilityWithSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), checkNameAvailabilityInput, accept, context); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + checkNameAvailabilityWithSubscriptionAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithSubscriptionWithResponseAsync(checkNameAvailabilityInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + return checkNameAvailabilityWithSubscriptionWithResponseAsync(checkNameAvailabilityInput, context).block(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityOutputInner + checkNameAvailabilityWithSubscription(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithSubscriptionWithResponse(checkNameAvailabilityInput, Context.NONE).getValue(); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + validateProbeWithResponseAsync(ValidateProbeInput validateProbeInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (validateProbeInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateProbeInput is required and cannot be null.")); + } else { + validateProbeInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateProbe(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), validateProbeInput, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + validateProbeWithResponseAsync(ValidateProbeInput validateProbeInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (validateProbeInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateProbeInput is required and cannot be null.")); + } else { + validateProbeInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.validateProbe(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), validateProbeInput, accept, context); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateProbeAsync(ValidateProbeInput validateProbeInput) { + return validateProbeWithResponseAsync(validateProbeInput).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateProbeWithResponse(ValidateProbeInput validateProbeInput, + Context context) { + return validateProbeWithResponseAsync(validateProbeInput, context).block(); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateProbeOutputInner validateProbe(ValidateProbeInput validateProbeInput) { + return validateProbeWithResponse(validateProbeInput, Context.NONE).getValue(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersImpl.java new file mode 100644 index 000000000000..8d6930405334 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityOutput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityOutput; +import com.azure.resourcemanager.cdn.generated.models.ResourceProviders; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeOutput; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public ResourceProvidersImpl(ResourceProvidersClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + Context context) { + Response inner = this.serviceClient() + .checkEndpointNameAvailabilityWithResponse(resourceGroupName, checkEndpointNameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckEndpointNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckEndpointNameAvailabilityOutput checkEndpointNameAvailability(String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + CheckEndpointNameAvailabilityOutputInner inner + = this.serviceClient().checkEndpointNameAvailability(resourceGroupName, checkEndpointNameAvailabilityInput); + if (inner != null) { + return new CheckEndpointNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = this.serviceClient().checkNameAvailability(checkNameAvailabilityInput); + if (inner != null) { + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + Response inner = this.serviceClient() + .checkNameAvailabilityWithSubscriptionWithResponse(checkNameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityOutput + checkNameAvailabilityWithSubscription(CheckNameAvailabilityInput checkNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner + = this.serviceClient().checkNameAvailabilityWithSubscription(checkNameAvailabilityInput); + if (inner != null) { + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateProbeWithResponse(ValidateProbeInput validateProbeInput, + Context context) { + Response inner + = this.serviceClient().validateProbeWithResponse(validateProbeInput, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidateProbeOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateProbeOutput validateProbe(ValidateProbeInput validateProbeInput) { + ValidateProbeOutputInner inner = this.serviceClient().validateProbe(validateProbeInput); + if (inner != null) { + return new ValidateProbeOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsageImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsageImpl.java new file mode 100644 index 000000000000..7f870f409e3a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsageImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageUnit; + +public final class ResourceUsageImpl implements ResourceUsage { + private ResourceUsageInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ResourceUsageImpl(ResourceUsageInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public ResourceUsageUnit unit() { + return this.innerModel().unit(); + } + + public Integer currentValue() { + return this.innerModel().currentValue(); + } + + public Integer limit() { + return this.innerModel().limit(); + } + + public ResourceUsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesClientImpl.java new file mode 100644 index 000000000000..33e49dc1dd1b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceUsagesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ResourceUsagesClient. + */ +public final class ResourceUsagesClientImpl implements ResourceUsagesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ResourceUsagesService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of ResourceUsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceUsagesClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(ResourceUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientResourceUsages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + public interface ResourceUsagesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesImpl.java new file mode 100644 index 000000000000..01f1ac4ef0c2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceUsagesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsages; + +public final class ResourceUsagesImpl implements ResourceUsages { + private static final ClientLogger LOGGER = new ClientLogger(ResourceUsagesImpl.class); + + private final ResourceUsagesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public ResourceUsagesImpl(ResourceUsagesClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + private ResourceUsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourcesResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourcesResponseImpl.java new file mode 100644 index 000000000000..f4f411685809 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourcesResponseImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponse; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseCustomDomainsItem; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseEndpointsItem; +import java.util.Collections; +import java.util.List; + +public final class ResourcesResponseImpl implements ResourcesResponse { + private ResourcesResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ResourcesResponseImpl(ResourcesResponseInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List endpoints() { + List inner = this.innerModel().endpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List customDomains() { + List inner = this.innerModel().customDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourcesResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RouteImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RouteImpl.java new file mode 100644 index 000000000000..1b29e6bacb41 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RouteImpl.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Route; +import com.azure.resourcemanager.cdn.generated.models.RouteUpdateParameters; +import java.util.Collections; +import java.util.List; + +public final class RouteImpl implements Route, Route.Definition, Route.Update { + private RouteInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String endpointName() { + return this.innerModel().endpointName(); + } + + public List customDomains() { + List inner = this.innerModel().customDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceReference originGroup() { + return this.innerModel().originGroup(); + } + + public String originPath() { + return this.innerModel().originPath(); + } + + public List ruleSets() { + List inner = this.innerModel().ruleSets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedProtocols() { + List inner = this.innerModel().supportedProtocols(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List patternsToMatch() { + List inner = this.innerModel().patternsToMatch(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AfdRouteCacheConfiguration cacheConfiguration() { + return this.innerModel().cacheConfiguration(); + } + + public ForwardingProtocol forwardingProtocol() { + return this.innerModel().forwardingProtocol(); + } + + public LinkToDefaultDomain linkToDefaultDomain() { + return this.innerModel().linkToDefaultDomain(); + } + + public HttpsRedirect httpsRedirect() { + return this.innerModel().httpsRedirect(); + } + + public EnabledState enabledState() { + return this.innerModel().enabledState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RouteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private String routeName; + + private RouteUpdateParameters updateRouteUpdateProperties; + + public RouteImpl withExistingAfdEndpoint(String resourceGroupName, String profileName, String endpointName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.endpointName = endpointName; + return this; + } + + public Route create() { + this.innerObject = serviceManager.serviceClient() + .getRoutes() + .create(resourceGroupName, profileName, endpointName, routeName, this.innerModel(), Context.NONE); + return this; + } + + public Route create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutes() + .create(resourceGroupName, profileName, endpointName, routeName, this.innerModel(), context); + return this; + } + + RouteImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new RouteInner(); + this.serviceManager = serviceManager; + this.routeName = name; + } + + public RouteImpl update() { + this.updateRouteUpdateProperties = new RouteUpdateParameters(); + return this; + } + + public Route apply() { + this.innerObject = serviceManager.serviceClient() + .getRoutes() + .update(resourceGroupName, profileName, endpointName, routeName, updateRouteUpdateProperties, Context.NONE); + return this; + } + + public Route apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutes() + .update(resourceGroupName, profileName, endpointName, routeName, updateRouteUpdateProperties, context); + return this; + } + + RouteImpl(RouteInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "afdEndpoints"); + this.routeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "routes"); + } + + public Route refresh() { + this.innerObject = serviceManager.serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, profileName, endpointName, routeName, Context.NONE) + .getValue(); + return this; + } + + public Route refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, profileName, endpointName, routeName, context) + .getValue(); + return this; + } + + public RouteImpl withCustomDomains(List customDomains) { + if (isInCreateMode()) { + this.innerModel().withCustomDomains(customDomains); + return this; + } else { + this.updateRouteUpdateProperties.withCustomDomains(customDomains); + return this; + } + } + + public RouteImpl withOriginGroup(ResourceReference originGroup) { + if (isInCreateMode()) { + this.innerModel().withOriginGroup(originGroup); + return this; + } else { + this.updateRouteUpdateProperties.withOriginGroup(originGroup); + return this; + } + } + + public RouteImpl withOriginPath(String originPath) { + if (isInCreateMode()) { + this.innerModel().withOriginPath(originPath); + return this; + } else { + this.updateRouteUpdateProperties.withOriginPath(originPath); + return this; + } + } + + public RouteImpl withRuleSets(List ruleSets) { + if (isInCreateMode()) { + this.innerModel().withRuleSets(ruleSets); + return this; + } else { + this.updateRouteUpdateProperties.withRuleSets(ruleSets); + return this; + } + } + + public RouteImpl withSupportedProtocols(List supportedProtocols) { + if (isInCreateMode()) { + this.innerModel().withSupportedProtocols(supportedProtocols); + return this; + } else { + this.updateRouteUpdateProperties.withSupportedProtocols(supportedProtocols); + return this; + } + } + + public RouteImpl withPatternsToMatch(List patternsToMatch) { + if (isInCreateMode()) { + this.innerModel().withPatternsToMatch(patternsToMatch); + return this; + } else { + this.updateRouteUpdateProperties.withPatternsToMatch(patternsToMatch); + return this; + } + } + + public RouteImpl withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + if (isInCreateMode()) { + this.innerModel().withCacheConfiguration(cacheConfiguration); + return this; + } else { + this.updateRouteUpdateProperties.withCacheConfiguration(cacheConfiguration); + return this; + } + } + + public RouteImpl withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + if (isInCreateMode()) { + this.innerModel().withForwardingProtocol(forwardingProtocol); + return this; + } else { + this.updateRouteUpdateProperties.withForwardingProtocol(forwardingProtocol); + return this; + } + } + + public RouteImpl withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + if (isInCreateMode()) { + this.innerModel().withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } else { + this.updateRouteUpdateProperties.withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } + } + + public RouteImpl withHttpsRedirect(HttpsRedirect httpsRedirect) { + if (isInCreateMode()) { + this.innerModel().withHttpsRedirect(httpsRedirect); + return this; + } else { + this.updateRouteUpdateProperties.withHttpsRedirect(httpsRedirect); + return this; + } + } + + public RouteImpl withEnabledState(EnabledState enabledState) { + if (isInCreateMode()) { + this.innerModel().withEnabledState(enabledState); + return this; + } else { + this.updateRouteUpdateProperties.withEnabledState(enabledState); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesClientImpl.java new file mode 100644 index 000000000000..17195e94a97a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesClientImpl.java @@ -0,0 +1,1358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.RoutesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.cdn.generated.models.RouteListResult; +import com.azure.resourcemanager.cdn.generated.models.RouteUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RoutesClient. + */ +public final class RoutesClientImpl implements RoutesClient { + /** + * The proxy service used to perform REST calls. + */ + private final RoutesService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of RoutesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoutesClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(RoutesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientRoutes to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + public interface RoutesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpoint(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("routeName") String routeName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("routeName") String routeName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RouteInner route, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("routeName") String routeName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RouteUpdateParameters routeUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, @PathParam("routeName") String routeName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync(String resourceGroupName, String profileName, + String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEndpoint(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync(String resourceGroupName, String profileName, + String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByEndpoint(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync(String resourceGroupName, String profileName, + String endpointName) { + return new PagedFlux<>(() -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listByEndpointNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync(String resourceGroupName, String profileName, String endpointName, + Context context) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listByEndpointNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String routeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + routeName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String routeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, routeName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName, + String routeName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, routeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String routeName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, context).block(); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner get(String resourceGroupName, String profileName, String endpointName, String routeName) { + return getWithResponse(resourceGroupName, profileName, endpointName, routeName, Context.NONE).getValue(); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteInner route) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (route == null) { + return Mono.error(new IllegalArgumentException("Parameter route is required and cannot be null.")); + } else { + route.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, + routeName, this.client.getSubscriptionId(), this.client.getApiVersion(), route, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteInner route, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (route == null) { + return Mono.error(new IllegalArgumentException("Parameter route is required and cannot be null.")); + } else { + route.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, routeName, + this.client.getSubscriptionId(), this.client.getApiVersion(), route, accept, context); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, String routeName, RouteInner route) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, route); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RouteInner.class, + RouteInner.class, this.client.getContext()); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteInner> beginCreateAsync(String resourceGroupName, + String profileName, String endpointName, String routeName, RouteInner route, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, route, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RouteInner.class, + RouteInner.class, context); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteInner route) { + return this.beginCreateAsync(resourceGroupName, profileName, endpointName, routeName, route).getSyncPoller(); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginCreate(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteInner route, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, endpointName, routeName, route, context) + .getSyncPoller(); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + String routeName, RouteInner route) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, routeName, route).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String endpointName, + String routeName, RouteInner route, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, routeName, route, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner create(String resourceGroupName, String profileName, String endpointName, String routeName, + RouteInner route) { + return createAsync(resourceGroupName, profileName, endpointName, routeName, route).block(); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner create(String resourceGroupName, String profileName, String endpointName, String routeName, + RouteInner route, Context context) { + return createAsync(resourceGroupName, profileName, endpointName, routeName, route, context).block(); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteUpdateParameters routeUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (routeUpdateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeUpdateProperties is required and cannot be null.")); + } else { + routeUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, routeName, this.client.getSubscriptionId(), this.client.getApiVersion(), + routeUpdateProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteUpdateParameters routeUpdateProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (routeUpdateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeUpdateProperties is required and cannot be null.")); + } else { + routeUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, routeName, + this.client.getSubscriptionId(), this.client.getApiVersion(), routeUpdateProperties, accept, context); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, String routeName, RouteUpdateParameters routeUpdateProperties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RouteInner.class, + RouteInner.class, this.client.getContext()); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteInner> beginUpdateAsync(String resourceGroupName, + String profileName, String endpointName, String routeName, RouteUpdateParameters routeUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, endpointName, + routeName, routeUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RouteInner.class, + RouteInner.class, context); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteUpdateParameters routeUpdateProperties) { + return this.beginUpdateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginUpdate(String resourceGroupName, String profileName, + String endpointName, String routeName, RouteUpdateParameters routeUpdateProperties, Context context) { + return this + .beginUpdateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + String routeName, RouteUpdateParameters routeUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String endpointName, + String routeName, RouteUpdateParameters routeUpdateProperties, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner update(String resourceGroupName, String profileName, String endpointName, String routeName, + RouteUpdateParameters routeUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties).block(); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner update(String resourceGroupName, String profileName, String endpointName, String routeName, + RouteUpdateParameters routeUpdateProperties, Context context) { + return updateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String routeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + endpointName, routeName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String endpointName, String routeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, endpointName, routeName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName, String routeName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, routeName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String endpointName, String routeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName, String routeName) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, routeName).getSyncPoller(); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String endpointName, String routeName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, endpointName, routeName, context).getSyncPoller(); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, + String routeName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, routeName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String endpointName, String routeName, + Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, routeName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName, String routeName) { + deleteAsync(resourceGroupName, profileName, endpointName, routeName).block(); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String endpointName, String routeName, + Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, routeName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEndpointNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByEndpointNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesImpl.java new file mode 100644 index 000000000000..23d32912637a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.RoutesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.cdn.generated.models.Route; +import com.azure.resourcemanager.cdn.generated.models.Routes; + +public final class RoutesImpl implements Routes { + private static final ClientLogger LOGGER = new ClientLogger(RoutesImpl.class); + + private final RoutesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public RoutesImpl(RoutesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner + = this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context) { + PagedIterable inner + = this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String routeName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, endpointName, routeName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RouteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Route get(String resourceGroupName, String profileName, String endpointName, String routeName) { + RouteInner inner = this.serviceClient().get(resourceGroupName, profileName, endpointName, routeName); + if (inner != null) { + return new RouteImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName, String routeName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, routeName); + } + + public void delete(String resourceGroupName, String profileName, String endpointName, String routeName, + Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, routeName, context); + } + + public Route getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, routeName, context); + } + + private RoutesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public RouteImpl define(String name) { + return new RouteImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleImpl.java new file mode 100644 index 000000000000..831ac408945c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleAction; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleCondition; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.MatchProcessingBehavior; +import com.azure.resourcemanager.cdn.generated.models.Rule; +import com.azure.resourcemanager.cdn.generated.models.RuleUpdateParameters; +import java.util.Collections; +import java.util.List; + +public final class RuleImpl implements Rule, Rule.Definition, Rule.Update { + private RuleInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String ruleSetName() { + return this.innerModel().ruleSetName(); + } + + public Integer order() { + return this.innerModel().order(); + } + + public List conditions() { + List inner = this.innerModel().conditions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MatchProcessingBehavior matchProcessingBehavior() { + return this.innerModel().matchProcessingBehavior(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String ruleSetName; + + private String ruleName; + + private RuleUpdateParameters updateRuleUpdateProperties; + + public RuleImpl withExistingRuleSet(String resourceGroupName, String profileName, String ruleSetName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.ruleSetName = ruleSetName; + return this; + } + + public Rule create() { + this.innerObject = serviceManager.serviceClient() + .getRules() + .create(resourceGroupName, profileName, ruleSetName, ruleName, this.innerModel(), Context.NONE); + return this; + } + + public Rule create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRules() + .create(resourceGroupName, profileName, ruleSetName, ruleName, this.innerModel(), context); + return this; + } + + RuleImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new RuleInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public RuleImpl update() { + this.updateRuleUpdateProperties = new RuleUpdateParameters(); + return this; + } + + public Rule apply() { + this.innerObject = serviceManager.serviceClient() + .getRules() + .update(resourceGroupName, profileName, ruleSetName, ruleName, updateRuleUpdateProperties, Context.NONE); + return this; + } + + public Rule apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRules() + .update(resourceGroupName, profileName, ruleSetName, ruleName, updateRuleUpdateProperties, context); + return this; + } + + RuleImpl(RuleInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.ruleSetName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ruleSets"); + this.ruleName = ResourceManagerUtils.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 000000000000..a05b3bddf855 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.RuleSet; + +public final class RuleSetImpl implements RuleSet { + private RuleSetInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + RuleSetImpl(RuleSetInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public RuleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsClientImpl.java new file mode 100644 index 000000000000..12734c78cc74 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsClientImpl.java @@ -0,0 +1,1076 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.RuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.RuleSetListResult; +import com.azure.resourcemanager.cdn.generated.models.UsagesListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RuleSetsClient. + */ +public final class RuleSetsClientImpl implements RuleSetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RuleSetsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of RuleSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RuleSetsClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(RuleSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientRuleSets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + public interface RuleSetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, String profileName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String ruleSetName) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, String ruleSetName, + Context context) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName, context).block(); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleSetInner get(String resourceGroupName, String profileName, String ruleSetName) { + return getWithResponse(resourceGroupName, profileName, ruleSetName, Context.NONE).getValue(); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, + ruleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String ruleSetName) { + return createWithResponseAsync(resourceGroupName, profileName, ruleSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String profileName, String ruleSetName, + Context context) { + return createWithResponseAsync(resourceGroupName, profileName, ruleSetName, context).block(); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleSetInner create(String resourceGroupName, String profileName, String ruleSetName) { + return createWithResponse(resourceGroupName, profileName, ruleSetName, Context.NONE).getValue(); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + ruleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String ruleSetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, ruleSetName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String ruleSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, ruleSetName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String ruleSetName) { + return this.beginDeleteAsync(resourceGroupName, profileName, ruleSetName).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String ruleSetName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, ruleSetName, context).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String ruleSetName) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String ruleSetName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String ruleSetName) { + deleteAsync(resourceGroupName, profileName, ruleSetName).block(); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String ruleSetName, Context context) { + deleteAsync(resourceGroupName, profileName, ruleSetName, context).block(); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, String ruleSetName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, + ruleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync(String resourceGroupName, + String profileName, String ruleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listResourceUsage(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + String ruleSetName) { + return new PagedFlux<>(() -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, ruleSetName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName, + String ruleSetName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, ruleSetName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, + String ruleSetName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, ruleSetName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName, + Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, ruleSetName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listResourceUsageNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsImpl.java new file mode 100644 index 000000000000..0f286159912a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.RuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.RuleSet; +import com.azure.resourcemanager.cdn.generated.models.RuleSets; +import com.azure.resourcemanager.cdn.generated.models.Usage; + +public final class RuleSetsImpl implements RuleSets { + private static final ClientLogger LOGGER = new ClientLogger(RuleSetsImpl.class); + + private final RuleSetsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public RuleSetsImpl(RuleSetsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RuleSetImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RuleSetImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String ruleSetName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, ruleSetName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RuleSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RuleSet get(String resourceGroupName, String profileName, String ruleSetName) { + RuleSetInner inner = this.serviceClient().get(resourceGroupName, profileName, ruleSetName); + if (inner != null) { + return new RuleSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse(String resourceGroupName, String profileName, String ruleSetName, + Context context) { + Response inner + = this.serviceClient().createWithResponse(resourceGroupName, profileName, ruleSetName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RuleSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RuleSet create(String resourceGroupName, String profileName, String ruleSetName) { + RuleSetInner inner = this.serviceClient().create(resourceGroupName, profileName, ruleSetName); + if (inner != null) { + return new RuleSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String ruleSetName) { + this.serviceClient().delete(resourceGroupName, profileName, ruleSetName); + } + + public void delete(String resourceGroupName, String profileName, String ruleSetName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, ruleSetName, context); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, ruleSetName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName, + Context context) { + PagedIterable inner + = this.serviceClient().listResourceUsage(resourceGroupName, profileName, ruleSetName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private RuleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesClientImpl.java new file mode 100644 index 000000000000..0f13c68703cc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesClientImpl.java @@ -0,0 +1,1315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.RulesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.cdn.generated.models.RuleListResult; +import com.azure.resourcemanager.cdn.generated.models.RuleUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RulesClient. + */ +public final class RulesClientImpl implements RulesClient { + /** + * The proxy service used to perform REST calls. + */ + private final RulesService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of RulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RulesClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(RulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientRules to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + public interface RulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRuleSet(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, @PathParam("ruleName") String ruleName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, @PathParam("ruleName") String ruleName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RuleInner rule, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, @PathParam("ruleName") String ruleName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RuleUpdateParameters ruleUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, @PathParam("ruleName") String ruleName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRuleSetNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSetSinglePageAsync(String resourceGroupName, String profileName, + String ruleSetName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByRuleSet(this.client.getEndpoint(), resourceGroupName, profileName, + ruleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSetSinglePageAsync(String resourceGroupName, String profileName, + String ruleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByRuleSet(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRuleSetAsync(String resourceGroupName, String profileName, String ruleSetName) { + return new PagedFlux<>(() -> listByRuleSetSinglePageAsync(resourceGroupName, profileName, ruleSetName), + nextLink -> listByRuleSetNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRuleSetAsync(String resourceGroupName, String profileName, String ruleSetName, + Context context) { + return new PagedFlux<>(() -> listByRuleSetSinglePageAsync(resourceGroupName, profileName, ruleSetName, context), + nextLink -> listByRuleSetNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName) { + return new PagedIterable<>(listByRuleSetAsync(resourceGroupName, profileName, ruleSetName)); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName, + Context context) { + return new PagedIterable<>(listByRuleSetAsync(resourceGroupName, profileName, ruleSetName, context)); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, + ruleName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, ruleName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String ruleSetName, + String ruleName) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, String ruleSetName, + String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, context).block(); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner get(String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + return getWithResponse(resourceGroupName, profileName, ruleSetName, ruleName, Context.NONE).getValue(); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleInner rule) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (rule == null) { + return Mono.error(new IllegalArgumentException("Parameter rule is required and cannot be null.")); + } else { + rule.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, + ruleName, this.client.getSubscriptionId(), this.client.getApiVersion(), rule, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleInner rule, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (rule == null) { + return Mono.error(new IllegalArgumentException("Parameter rule is required and cannot be null.")); + } else { + rule.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, ruleName, + this.client.getSubscriptionId(), this.client.getApiVersion(), rule, accept, context); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RuleInner> beginCreateAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleInner rule) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RuleInner.class, + RuleInner.class, this.client.getContext()); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RuleInner> beginCreateAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleInner rule, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RuleInner.class, + RuleInner.class, context); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RuleInner> beginCreate(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleInner rule) { + return this.beginCreateAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule).getSyncPoller(); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RuleInner> beginCreate(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleInner rule, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule, context) + .getSyncPoller(); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String ruleSetName, + String ruleName, RuleInner rule) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String ruleSetName, + String ruleName, RuleInner rule, Context context) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner create(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + RuleInner rule) { + return createAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule).block(); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner create(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + RuleInner rule, Context context) { + return createAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule, context).block(); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleUpdateParameters ruleUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ruleUpdateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleUpdateProperties is required and cannot be null.")); + } else { + ruleUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, profileName, + ruleSetName, ruleName, this.client.getSubscriptionId(), this.client.getApiVersion(), + ruleUpdateProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleUpdateParameters ruleUpdateProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ruleUpdateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleUpdateProperties is required and cannot be null.")); + } else { + ruleUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, ruleName, + this.client.getSubscriptionId(), this.client.getApiVersion(), ruleUpdateProperties, accept, context); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RuleInner> beginUpdateAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleUpdateParameters ruleUpdateProperties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RuleInner.class, + RuleInner.class, this.client.getContext()); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RuleInner> beginUpdateAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleUpdateParameters ruleUpdateProperties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, ruleSetName, + ruleName, ruleUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RuleInner.class, + RuleInner.class, context); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RuleInner> beginUpdate(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleUpdateParameters ruleUpdateProperties) { + return this.beginUpdateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RuleInner> beginUpdate(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, RuleUpdateParameters ruleUpdateProperties, Context context) { + return this + .beginUpdateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String ruleSetName, + String ruleName, RuleUpdateParameters ruleUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String profileName, String ruleSetName, + String ruleName, RuleUpdateParameters ruleUpdateProperties, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner update(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + RuleUpdateParameters ruleUpdateProperties) { + return updateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties).block(); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner update(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + RuleUpdateParameters ruleUpdateProperties, Context context) { + return updateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + ruleSetName, ruleName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, ruleSetName, ruleName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String ruleSetName, String ruleName) { + return this.beginDeleteAsync(resourceGroupName, profileName, ruleSetName, ruleName).getSyncPoller(); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String ruleSetName, String ruleName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, ruleSetName, ruleName, context).getSyncPoller(); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName, ruleName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + Context context) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName, ruleName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + deleteAsync(resourceGroupName, profileName, ruleSetName, ruleName).block(); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + Context context) { + deleteAsync(resourceGroupName, profileName, ruleSetName, ruleName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSetNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByRuleSetNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSetNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByRuleSetNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesImpl.java new file mode 100644 index 000000000000..ab8ccaf01cb2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.RulesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.cdn.generated.models.Rule; +import com.azure.resourcemanager.cdn.generated.models.Rules; + +public final class RulesImpl implements Rules { + private static final ClientLogger LOGGER = new ClientLogger(RulesImpl.class); + + private final RulesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public RulesImpl(RulesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName) { + PagedIterable inner + = this.serviceClient().listByRuleSet(resourceGroupName, profileName, ruleSetName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RuleImpl(inner1, this.manager())); + } + + public PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName, + Context context) { + PagedIterable inner + = this.serviceClient().listByRuleSet(resourceGroupName, profileName, ruleSetName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RuleImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String ruleSetName, + String ruleName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, ruleSetName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Rule get(String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + RuleInner inner = this.serviceClient().get(resourceGroupName, profileName, ruleSetName, ruleName); + if (inner != null) { + return new RuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + this.serviceClient().delete(resourceGroupName, profileName, ruleSetName, ruleName); + } + + public void delete(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + Context context) { + this.serviceClient().delete(resourceGroupName, profileName, ruleSetName, ruleName, context); + } + + public Rule getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + this.delete(resourceGroupName, profileName, ruleSetName, ruleName, context); + } + + private RulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public RuleImpl define(String name) { + return new RuleImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretImpl.java new file mode 100644 index 000000000000..31e81795a42c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretImpl.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.Secret; +import com.azure.resourcemanager.cdn.generated.models.SecretParameters; + +public final class SecretImpl implements Secret, Secret.Definition { + private SecretInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + SecretImpl(SecretInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public SecretParameters parameters() { + return this.innerModel().parameters(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public SecretInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String secretName; + + public SecretImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public Secret create() { + this.innerObject = serviceManager.serviceClient() + .getSecrets() + .create(resourceGroupName, profileName, secretName, this.innerModel(), Context.NONE); + return this; + } + + public Secret create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecrets() + .create(resourceGroupName, profileName, secretName, this.innerModel(), context); + return this; + } + + SecretImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new SecretInner(); + this.serviceManager = serviceManager; + this.secretName = name; + } + + public Secret refresh() { + this.innerObject = serviceManager.serviceClient() + .getSecrets() + .getWithResponse(resourceGroupName, profileName, secretName, Context.NONE) + .getValue(); + return this; + } + + public Secret refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecrets() + .getWithResponse(resourceGroupName, profileName, secretName, context) + .getValue(); + return this; + } + + public SecretImpl withParameters(SecretParameters parameters) { + this.innerModel().withParameters(parameters); + return this; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsClientImpl.java new file mode 100644 index 000000000000..8e842769f4a5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsClientImpl.java @@ -0,0 +1,946 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.SecretsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.cdn.generated.models.SecretListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SecretsClient. + */ +public final class SecretsClientImpl implements SecretsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecretsService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of SecretsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecretsClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(SecretsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientSecrets to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientS") + public interface SecretsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("secretName") String secretName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("secretName") String secretName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SecretInner secret, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("secretName") String secretName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, String profileName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String secretName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, secretName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String secretName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, secretName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String secretName) { + return getWithResponseAsync(resourceGroupName, profileName, secretName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, String secretName, + Context context) { + return getWithResponseAsync(resourceGroupName, profileName, secretName, context).block(); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner get(String resourceGroupName, String profileName, String secretName) { + return getWithResponse(resourceGroupName, profileName, secretName, Context.NONE).getValue(); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String secretName, SecretInner secret) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (secret == null) { + return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); + } else { + secret.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, + secretName, this.client.getSubscriptionId(), this.client.getApiVersion(), secret, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String secretName, SecretInner secret, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (secret == null) { + return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); + } else { + secret.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, secretName, + this.client.getSubscriptionId(), this.client.getApiVersion(), secret, accept, context); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretInner> beginCreateAsync(String resourceGroupName, + String profileName, String secretName, SecretInner secret) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, secretName, secret); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SecretInner.class, SecretInner.class, this.client.getContext()); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretInner> beginCreateAsync(String resourceGroupName, + String profileName, String secretName, SecretInner secret, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, secretName, secret, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SecretInner.class, SecretInner.class, context); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretInner> beginCreate(String resourceGroupName, String profileName, + String secretName, SecretInner secret) { + return this.beginCreateAsync(resourceGroupName, profileName, secretName, secret).getSyncPoller(); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretInner> beginCreate(String resourceGroupName, String profileName, + String secretName, SecretInner secret, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, secretName, secret, context).getSyncPoller(); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String secretName, + SecretInner secret) { + return beginCreateAsync(resourceGroupName, profileName, secretName, secret).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String secretName, + SecretInner secret, Context context) { + return beginCreateAsync(resourceGroupName, profileName, secretName, secret, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner create(String resourceGroupName, String profileName, String secretName, SecretInner secret) { + return createAsync(resourceGroupName, profileName, secretName, secret).block(); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner create(String resourceGroupName, String profileName, String secretName, SecretInner secret, + Context context) { + return createAsync(resourceGroupName, profileName, secretName, secret, context).block(); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String secretName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + secretName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String secretName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, secretName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String secretName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, secretName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String secretName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, secretName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String secretName) { + return this.beginDeleteAsync(resourceGroupName, profileName, secretName).getSyncPoller(); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String secretName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, secretName, context).getSyncPoller(); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String secretName) { + return beginDeleteAsync(resourceGroupName, profileName, secretName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String secretName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, secretName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String secretName) { + deleteAsync(resourceGroupName, profileName, secretName).block(); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String secretName, Context context) { + deleteAsync(resourceGroupName, profileName, secretName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsImpl.java new file mode 100644 index 000000000000..368998387657 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.SecretsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.cdn.generated.models.Secret; +import com.azure.resourcemanager.cdn.generated.models.Secrets; + +public final class SecretsImpl implements Secrets { + private static final ClientLogger LOGGER = new ClientLogger(SecretsImpl.class); + + private final SecretsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public SecretsImpl(SecretsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, String secretName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, secretName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecretImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Secret get(String resourceGroupName, String profileName, String secretName) { + SecretInner inner = this.serviceClient().get(resourceGroupName, profileName, secretName); + if (inner != null) { + return new SecretImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String secretName) { + this.serviceClient().delete(resourceGroupName, profileName, secretName); + } + + public void delete(String resourceGroupName, String profileName, String secretName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, secretName, context); + } + + public Secret getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "secrets"); + if (secretName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + this.delete(resourceGroupName, profileName, secretName, context); + } + + private SecretsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public SecretImpl define(String name) { + return new SecretImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesClientImpl.java new file mode 100644 index 000000000000..2c52f6c06126 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesClientImpl.java @@ -0,0 +1,1248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.SecurityPoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyListResult; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SecurityPoliciesClient. + */ +public final class SecurityPoliciesClientImpl implements SecurityPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecurityPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of SecurityPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityPoliciesClientImpl(CdnManagementClientImpl client) { + this.service + = RestProxy.create(SecurityPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientSecurityPolicies to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientS") + public interface SecurityPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("securityPolicyName") String securityPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("securityPolicyName") String securityPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SecurityPolicyInner securityPolicy, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> patch(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("securityPolicyName") String securityPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName, + @PathParam("securityPolicyName") String securityPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync(String resourceGroupName, + String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProfile(this.client.getEndpoint(), resourceGroupName, profileName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, + Context context) { + return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, + Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String securityPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, profileName, + securityPolicyName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String profileName, + String securityPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, profileName, securityPolicyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, + String securityPolicyName) { + return getWithResponseAsync(resourceGroupName, profileName, securityPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String profileName, + String securityPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, securityPolicyName, context).block(); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner get(String resourceGroupName, String profileName, String securityPolicyName) { + return getWithResponse(resourceGroupName, profileName, securityPolicyName, Context.NONE).getValue(); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String securityPolicyName, SecurityPolicyInner securityPolicy) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (securityPolicy == null) { + return Mono.error(new IllegalArgumentException("Parameter securityPolicy is required and cannot be null.")); + } else { + securityPolicy.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, profileName, securityPolicyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), securityPolicy, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String profileName, + String securityPolicyName, SecurityPolicyInner securityPolicy, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (securityPolicy == null) { + return Mono.error(new IllegalArgumentException("Parameter securityPolicy is required and cannot be null.")); + } else { + securityPolicy.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, profileName, securityPolicyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), securityPolicy, accept, context); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecurityPolicyInner> beginCreateAsync(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SecurityPolicyInner.class, SecurityPolicyInner.class, this.client.getContext()); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecurityPolicyInner> beginCreateAsync(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SecurityPolicyInner.class, SecurityPolicyInner.class, context); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPolicyInner> beginCreate(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy) { + return this.beginCreateAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy) + .getSyncPoller(); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPolicyInner> beginCreate(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy, Context context) { + return this.beginCreateAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy, context) + .getSyncPoller(); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, + String securityPolicyName, SecurityPolicyInner securityPolicy) { + return beginCreateAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, + String securityPolicyName, SecurityPolicyInner securityPolicy, Context context) { + return beginCreateAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner create(String resourceGroupName, String profileName, String securityPolicyName, + SecurityPolicyInner securityPolicy) { + return createAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy).block(); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner create(String resourceGroupName, String profileName, String securityPolicyName, + SecurityPolicyInner securityPolicy, Context context) { + return createAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy, context).block(); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> patchWithResponseAsync(String resourceGroupName, String profileName, + String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (securityPolicyUpdateProperties == null) { + return Mono.error(new IllegalArgumentException( + "Parameter securityPolicyUpdateProperties is required and cannot be null.")); + } else { + securityPolicyUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patch(this.client.getEndpoint(), resourceGroupName, profileName, + securityPolicyName, this.client.getSubscriptionId(), this.client.getApiVersion(), + securityPolicyUpdateProperties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> patchWithResponseAsync(String resourceGroupName, String profileName, + String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (securityPolicyUpdateProperties == null) { + return Mono.error(new IllegalArgumentException( + "Parameter securityPolicyUpdateProperties is required and cannot be null.")); + } else { + securityPolicyUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.patch(this.client.getEndpoint(), resourceGroupName, profileName, securityPolicyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), securityPolicyUpdateProperties, accept, + context); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecurityPolicyInner> beginPatchAsync(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + Mono>> mono = patchWithResponseAsync(resourceGroupName, profileName, + securityPolicyName, securityPolicyUpdateProperties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SecurityPolicyInner.class, SecurityPolicyInner.class, this.client.getContext()); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecurityPolicyInner> beginPatchAsync(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = patchWithResponseAsync(resourceGroupName, profileName, + securityPolicyName, securityPolicyUpdateProperties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SecurityPolicyInner.class, SecurityPolicyInner.class, context); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPolicyInner> beginPatch(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + return this.beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPolicyInner> beginPatch(String resourceGroupName, + String profileName, String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + Context context) { + return this + .beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties, + context) + .getSyncPoller(); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync(String resourceGroupName, String profileName, + String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + return beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync(String resourceGroupName, String profileName, + String securityPolicyName, SecurityPolicyUpdateParameters securityPolicyUpdateProperties, Context context) { + return beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner patch(String resourceGroupName, String profileName, String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + return patchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties).block(); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner patch(String resourceGroupName, String profileName, String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties, Context context) { + return patchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String securityPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, profileName, + securityPolicyName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName, + String securityPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, securityPolicyName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String securityPolicyName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, securityPolicyName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName, + String securityPolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, profileName, securityPolicyName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String securityPolicyName) { + return this.beginDeleteAsync(resourceGroupName, profileName, securityPolicyName).getSyncPoller(); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, + String securityPolicyName, Context context) { + return this.beginDeleteAsync(resourceGroupName, profileName, securityPolicyName, context).getSyncPoller(); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String securityPolicyName) { + return beginDeleteAsync(resourceGroupName, profileName, securityPolicyName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String securityPolicyName, + Context context) { + return beginDeleteAsync(resourceGroupName, profileName, securityPolicyName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String securityPolicyName) { + deleteAsync(resourceGroupName, profileName, securityPolicyName).block(); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, String securityPolicyName, Context context) { + deleteAsync(resourceGroupName, profileName, securityPolicyName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesImpl.java new file mode 100644 index 000000000000..9857a698bdff --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.SecurityPoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicies; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicy; + +public final class SecurityPoliciesImpl implements SecurityPolicies { + private static final ClientLogger LOGGER = new ClientLogger(SecurityPoliciesImpl.class); + + private final SecurityPoliciesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public SecurityPoliciesImpl(SecurityPoliciesClient innerClient, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner + = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityPolicyImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String profileName, + String securityPolicyName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, profileName, securityPolicyName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecurityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecurityPolicy get(String resourceGroupName, String profileName, String securityPolicyName) { + SecurityPolicyInner inner = this.serviceClient().get(resourceGroupName, profileName, securityPolicyName); + if (inner != null) { + return new SecurityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String securityPolicyName) { + this.serviceClient().delete(resourceGroupName, profileName, securityPolicyName); + } + + public void delete(String resourceGroupName, String profileName, String securityPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, securityPolicyName, context); + } + + public SecurityPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "securityPolicies"); + if (securityPolicyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityPolicies'.", id))); + } + this.delete(resourceGroupName, profileName, securityPolicyName, context); + } + + private SecurityPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public SecurityPolicyImpl define(String name) { + return new SecurityPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPolicyImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPolicyImpl.java new file mode 100644 index 000000000000..c7b5a807a45c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPolicyImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicy; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyPropertiesParameters; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyUpdateParameters; + +public final class SecurityPolicyImpl implements SecurityPolicy, SecurityPolicy.Definition, SecurityPolicy.Update { + private SecurityPolicyInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public SecurityPolicyPropertiesParameters parameters() { + return this.innerModel().parameters(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SecurityPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String securityPolicyName; + + private SecurityPolicyUpdateParameters updateSecurityPolicyUpdateProperties; + + public SecurityPolicyImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public SecurityPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getSecurityPolicies() + .create(resourceGroupName, profileName, securityPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public SecurityPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityPolicies() + .create(resourceGroupName, profileName, securityPolicyName, this.innerModel(), context); + return this; + } + + SecurityPolicyImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new SecurityPolicyInner(); + this.serviceManager = serviceManager; + this.securityPolicyName = name; + } + + public SecurityPolicyImpl update() { + this.updateSecurityPolicyUpdateProperties = new SecurityPolicyUpdateParameters(); + return this; + } + + public SecurityPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getSecurityPolicies() + .patch(resourceGroupName, profileName, securityPolicyName, updateSecurityPolicyUpdateProperties, + Context.NONE); + return this; + } + + public SecurityPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityPolicies() + .patch(resourceGroupName, profileName, securityPolicyName, updateSecurityPolicyUpdateProperties, context); + return this; + } + + SecurityPolicyImpl(SecurityPolicyInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "profiles"); + this.securityPolicyName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityPolicies"); + } + + public SecurityPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getSecurityPolicies() + .getWithResponse(resourceGroupName, profileName, securityPolicyName, Context.NONE) + .getValue(); + return this; + } + + public SecurityPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityPolicies() + .getWithResponse(resourceGroupName, profileName, securityPolicyName, context) + .getValue(); + return this; + } + + public SecurityPolicyImpl withParameters(SecurityPolicyPropertiesParameters parameters) { + if (isInCreateMode()) { + this.innerModel().withParameters(parameters); + return this; + } else { + this.updateSecurityPolicyUpdateProperties.withParameters(parameters); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SsoUriImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SsoUriImpl.java new file mode 100644 index 000000000000..e3a07853880a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SsoUriImpl.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner; +import com.azure.resourcemanager.cdn.generated.models.SsoUri; + +public final class SsoUriImpl implements SsoUri { + private SsoUriInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + SsoUriImpl(SsoUriInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String ssoUriValue() { + return this.innerModel().ssoUriValue(); + } + + public SsoUriInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SupportedOptimizationTypesListResultImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SupportedOptimizationTypesListResultImpl.java new file mode 100644 index 000000000000..4e21de45b1dd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SupportedOptimizationTypesListResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.SupportedOptimizationTypesListResult; +import java.util.Collections; +import java.util.List; + +public final class SupportedOptimizationTypesListResultImpl implements SupportedOptimizationTypesListResult { + private SupportedOptimizationTypesListResultInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + SupportedOptimizationTypesListResultImpl(SupportedOptimizationTypesListResultInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List supportedOptimizationTypes() { + List inner = this.innerModel().supportedOptimizationTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SupportedOptimizationTypesListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/UsageImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/UsageImpl.java new file mode 100644 index 000000000000..c621d722ab92 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/UsageImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.Usage; +import com.azure.resourcemanager.cdn.generated.models.UsageName; +import com.azure.resourcemanager.cdn.generated.models.UsageUnit; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public UsageUnit unit() { + return this.innerModel().unit(); + } + + public long currentValue() { + return this.innerModel().currentValue(); + } + + public long limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/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 000000000000..086b5d30bdde --- /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.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; + +public final class ValidateCustomDomainOutputImpl implements ValidateCustomDomainOutput { + private ValidateCustomDomainOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ValidateCustomDomainOutputImpl(ValidateCustomDomainOutputInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean customDomainValidated() { + return this.innerModel().customDomainValidated(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public ValidateCustomDomainOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateProbeOutputImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateProbeOutputImpl.java new file mode 100644 index 000000000000..73425b3a3bb4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateProbeOutputImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeOutput; + +public final class ValidateProbeOutputImpl implements ValidateProbeOutput { + private ValidateProbeOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ValidateProbeOutputImpl(ValidateProbeOutputInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean isValid() { + return this.innerModel().isValid(); + } + + public String errorCode() { + return this.innerModel().errorCode(); + } + + public String message() { + return this.innerModel().message(); + } + + public ValidateProbeOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateSecretOutputImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateSecretOutputImpl.java new file mode 100644 index 000000000000..fe64c0cdfdfb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateSecretOutputImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.Status; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretOutput; + +public final class ValidateSecretOutputImpl implements ValidateSecretOutput { + private ValidateSecretOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ValidateSecretOutputImpl(ValidateSecretOutputInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Status status() { + return this.innerModel().status(); + } + + public String message() { + return this.innerModel().message(); + } + + public ValidateSecretOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafMetricsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafMetricsResponseImpl.java new file mode 100644 index 000000000000..0bf5820eb9f2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafMetricsResponseImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponseSeriesItem; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class WafMetricsResponseImpl implements WafMetricsResponse { + private WafMetricsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + WafMetricsResponseImpl(WafMetricsResponseInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public WafMetricsGranularity granularity() { + return this.innerModel().granularity(); + } + + public List series() { + List inner = this.innerModel().series(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public WafMetricsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafRankingsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafRankingsResponseImpl.java new file mode 100644 index 000000000000..4cb3e6a7d188 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafRankingsResponseImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.WafRankingsResponse; +import com.azure.resourcemanager.cdn.generated.models.WafRankingsResponseDataItem; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class WafRankingsResponseImpl implements WafRankingsResponse { + private WafRankingsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + WafRankingsResponseImpl(WafRankingsResponseInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public List groups() { + List inner = this.innerModel().groups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List data() { + List inner = this.innerModel().data(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public WafRankingsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/package-info.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/package-info.java new file mode 100644 index 000000000000..25ac750d2b94 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/package-info.java @@ -0,0 +1,9 @@ +// 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 000000000000..db0086862b2d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActionType.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 java.util.Collection; + +/** + * Defines the action to take on rule match. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Allow for ActionType. + */ + public static final ActionType ALLOW = fromString("Allow"); + + /** + * Static value Block for ActionType. + */ + public static final ActionType BLOCK = fromString("Block"); + + /** + * Static value Log for ActionType. + */ + public static final ActionType LOG = fromString("Log"); + + /** + * Static value Redirect for ActionType. + */ + public static final ActionType REDIRECT = fromString("Redirect"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActivatedResourceReference.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActivatedResourceReference.java new file mode 100644 index 000000000000..9829d9c9a1b1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActivatedResourceReference.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Reference to another resource along with its state. + */ +@Fluent +public final class ActivatedResourceReference implements JsonSerializable { + /* + * Resource ID. + */ + private String id; + + /* + * Whether the resource is active or inactive + */ + private Boolean isActive; + + /** + * Creates an instance of ActivatedResourceReference class. + */ + public ActivatedResourceReference() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ActivatedResourceReference object itself. + */ + public ActivatedResourceReference withId(String id) { + this.id = id; + return this; + } + + /** + * Get the isActive property: Whether the resource is active or inactive. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivatedResourceReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivatedResourceReference if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActivatedResourceReference. + */ + public static ActivatedResourceReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivatedResourceReference deserializedActivatedResourceReference = new ActivatedResourceReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedActivatedResourceReference.id = reader.getString(); + } else if ("isActive".equals(fieldName)) { + deserializedActivatedResourceReference.isActive = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedActivatedResourceReference; + }); + } +} 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 000000000000..10f27ab7ac90 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCertificateType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the source of the SSL certificate. + */ +public final class AfdCertificateType extends ExpandableStringEnum { + /** + * Static value CustomerCertificate for AfdCertificateType. + */ + public static final AfdCertificateType CUSTOMER_CERTIFICATE = fromString("CustomerCertificate"); + + /** + * Static value ManagedCertificate for AfdCertificateType. + */ + public static final AfdCertificateType MANAGED_CERTIFICATE = fromString("ManagedCertificate"); + + /** + * Static value AzureFirstPartyManagedCertificate for AfdCertificateType. + */ + public static final AfdCertificateType AZURE_FIRST_PARTY_MANAGED_CERTIFICATE + = fromString("AzureFirstPartyManagedCertificate"); + + /** + * Creates a new instance of AfdCertificateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AfdCertificateType() { + } + + /** + * Creates or finds a AfdCertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AfdCertificateType. + */ + public static AfdCertificateType fromString(String name) { + return fromString(name, AfdCertificateType.class); + } + + /** + * Gets known AfdCertificateType values. + * + * @return known AfdCertificateType values. + */ + public static Collection values() { + return values(AfdCertificateType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCustomDomains.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCustomDomains.java new file mode 100644 index 000000000000..9b7b817dbf6e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCustomDomains.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AfdCustomDomains. + */ +public interface AfdCustomDomains { + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String customDomainName, + Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + */ + AfdDomain get(String resourceGroupName, String profileName, String customDomainName); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String customDomainName); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String customDomainName, Context context); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void refreshValidationToken(String resourceGroupName, String profileName, String customDomainName); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void refreshValidationToken(String resourceGroupName, String profileName, String customDomainName, Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + AfdDomain getById(String id); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AfdDomain resource. + * + * @param name resource name. + * @return the first stage of the new AfdDomain definition. + */ + AfdDomain.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomain.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomain.java new file mode 100644 index 000000000000..b4499dd5b310 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomain.java @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import java.util.Map; + +/** + * An immutable client-side representation of AfdDomain. + */ +public interface AfdDomain { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the domainValidationState property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. DCV stands for DomainControlValidation. + * + * @return the domainValidationState value. + */ + DomainValidationState domainValidationState(); + + /** + * Gets the hostname property: The host name of the domain. Must be a domain name. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @return the extendedProperties value. + */ + Map extendedProperties(); + + /** + * Gets the validationProperties property: Values the customer needs to validate domain ownership. + * + * @return the validationProperties value. + */ + DomainValidationProperties validationProperties(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the profileName property: The name of the profile which holds the domain. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @return the tlsSettings value. + */ + AfdDomainHttpsParameters tlsSettings(); + + /** + * Gets the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @return the azureDnsZone value. + */ + ResourceReference azureDnsZone(); + + /** + * Gets the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom + * domain ownership was prevalidated. + * + * @return the preValidatedCustomDomainResourceId value. + */ + ResourceReference preValidatedCustomDomainResourceId(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner object. + * + * @return the inner object. + */ + AfdDomainInner innerModel(); + + /** + * The entirety of the AfdDomain definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AfdDomain definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AfdDomain definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AfdDomain definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + + /** + * The stage of the AfdDomain definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithHostname, DefinitionStages.WithExtendedProperties, + DefinitionStages.WithTlsSettings, DefinitionStages.WithAzureDnsZone, + DefinitionStages.WithPreValidatedCustomDomainResourceId { + /** + * Executes the create request. + * + * @return the created resource. + */ + AfdDomain create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AfdDomain create(Context context); + } + + /** + * The stage of the AfdDomain definition allowing to specify hostname. + */ + interface WithHostname { + /** + * Specifies the hostname property: The host name of the domain. Must be a domain name.. + * + * @param hostname The host name of the domain. Must be a domain name. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + + /** + * The stage of the AfdDomain definition allowing to specify extendedProperties. + */ + interface WithExtendedProperties { + /** + * Specifies the extendedProperties property: Key-Value pair representing migration properties for domains.. + * + * @param extendedProperties Key-Value pair representing migration properties for domains. + * @return the next definition stage. + */ + WithCreate withExtendedProperties(Map extendedProperties); + } + + /** + * The stage of the AfdDomain definition allowing to specify tlsSettings. + */ + interface WithTlsSettings { + /** + * Specifies the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - + * using AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses + * AzureFrontDoor managed certificate by default.. + * + * @param tlsSettings The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor + * managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor managed + * certificate by default. + * @return the next definition stage. + */ + WithCreate withTlsSettings(AfdDomainHttpsParameters tlsSettings); + } + + /** + * The stage of the AfdDomain definition allowing to specify azureDnsZone. + */ + interface WithAzureDnsZone { + /** + * Specifies the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone Resource reference to the Azure DNS zone. + * @return the next definition stage. + */ + WithCreate withAzureDnsZone(ResourceReference azureDnsZone); + } + + /** + * The stage of the AfdDomain definition allowing to specify preValidatedCustomDomainResourceId. + */ + interface WithPreValidatedCustomDomainResourceId { + /** + * Specifies the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where + * custom domain ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * @return the next definition stage. + */ + WithCreate withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId); + } + } + + /** + * Begins update for the AfdDomain resource. + * + * @return the stage of resource update. + */ + AfdDomain.Update update(); + + /** + * The template for AfdDomain update. + */ + interface Update extends UpdateStages.WithTlsSettings, UpdateStages.WithAzureDnsZone, + UpdateStages.WithPreValidatedCustomDomainResourceId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AfdDomain apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AfdDomain apply(Context context); + } + + /** + * The AfdDomain update stages. + */ + interface UpdateStages { + /** + * The stage of the AfdDomain update allowing to specify tlsSettings. + */ + interface WithTlsSettings { + /** + * Specifies the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - + * using AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses + * AzureFrontDoor managed certificate by default.. + * + * @param tlsSettings The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor + * managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor managed + * certificate by default. + * @return the next definition stage. + */ + Update withTlsSettings(AfdDomainHttpsParameters tlsSettings); + } + + /** + * The stage of the AfdDomain update allowing to specify azureDnsZone. + */ + interface WithAzureDnsZone { + /** + * Specifies the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone Resource reference to the Azure DNS zone. + * @return the next definition stage. + */ + Update withAzureDnsZone(ResourceReference azureDnsZone); + } + + /** + * The stage of the AfdDomain update allowing to specify preValidatedCustomDomainResourceId. + */ + interface WithPreValidatedCustomDomainResourceId { + /** + * Specifies the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where + * custom domain ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * @return the next definition stage. + */ + Update withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AfdDomain refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AfdDomain refresh(Context context); + + /** + * Updates the domain validation token. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void refreshValidationToken(); + + /** + * Updates the domain validation token. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void refreshValidationToken(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainHttpsParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainHttpsParameters.java new file mode 100644 index 000000000000..542516827b85 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainHttpsParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The JSON object that contains the properties to secure a domain. + */ +@Fluent +public final class AfdDomainHttpsParameters implements JsonSerializable { + /* + * Defines the source of the SSL certificate. + */ + private AfdCertificateType certificateType; + + /* + * TLS protocol version that will be used for Https + */ + private AfdMinimumTlsVersion minimumTlsVersion; + + /* + * Resource reference to the secret. ie. subs/rg/profile/secret + */ + private ResourceReference secret; + + /** + * Creates an instance of AfdDomainHttpsParameters class. + */ + public AfdDomainHttpsParameters() { + } + + /** + * Get the certificateType property: Defines the source of the SSL certificate. + * + * @return the certificateType value. + */ + public AfdCertificateType certificateType() { + return this.certificateType; + } + + /** + * Set the certificateType property: Defines the source of the SSL certificate. + * + * @param certificateType the certificateType value to set. + * @return the AfdDomainHttpsParameters object itself. + */ + public AfdDomainHttpsParameters withCertificateType(AfdCertificateType certificateType) { + this.certificateType = certificateType; + return this; + } + + /** + * Get the minimumTlsVersion property: TLS protocol version that will be used for Https. + * + * @return the minimumTlsVersion value. + */ + public AfdMinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: TLS protocol version that will be used for Https. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the AfdDomainHttpsParameters object itself. + */ + public AfdDomainHttpsParameters withMinimumTlsVersion(AfdMinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the secret property: Resource reference to the secret. ie. subs/rg/profile/secret. + * + * @return the secret value. + */ + public ResourceReference secret() { + return this.secret; + } + + /** + * Set the secret property: Resource reference to the secret. ie. subs/rg/profile/secret. + * + * @param secret the secret value to set. + * @return the AfdDomainHttpsParameters object itself. + */ + public AfdDomainHttpsParameters withSecret(ResourceReference secret) { + this.secret = secret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property certificateType in model AfdDomainHttpsParameters")); + } + if (secret() != null) { + secret().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AfdDomainHttpsParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("certificateType", + this.certificateType == null ? null : this.certificateType.toString()); + jsonWriter.writeStringField("minimumTlsVersion", + this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); + jsonWriter.writeJsonField("secret", this.secret); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdDomainHttpsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdDomainHttpsParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AfdDomainHttpsParameters. + */ + public static AfdDomainHttpsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdDomainHttpsParameters deserializedAfdDomainHttpsParameters = new AfdDomainHttpsParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificateType".equals(fieldName)) { + deserializedAfdDomainHttpsParameters.certificateType + = AfdCertificateType.fromString(reader.getString()); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedAfdDomainHttpsParameters.minimumTlsVersion + = AfdMinimumTlsVersion.fromString(reader.getString()); + } else if ("secret".equals(fieldName)) { + deserializedAfdDomainHttpsParameters.secret = ResourceReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdDomainHttpsParameters; + }); + } +} 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 000000000000..4c733eeb6b3c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of AzureFrontDoor domains within a profile. + */ + private List value; + + /* + * URL to get the next set of domain objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of AfdDomainListResult class. + */ + public AfdDomainListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor domains within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of domain objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of domain objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the AfdDomainListResult object itself. + */ + public AfdDomainListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdDomainListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdDomainListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdDomainListResult. + */ + public static AfdDomainListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdDomainListResult deserializedAfdDomainListResult = new AfdDomainListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AfdDomainInner.fromJson(reader1)); + deserializedAfdDomainListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAfdDomainListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdDomainListResult; + }); + } +} 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 000000000000..ac9e5411c655 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdateParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainUpdatePropertiesParameters; +import java.io.IOException; + +/** + * The domain JSON object required for domain creation or update. + */ +@Fluent +public final class AfdDomainUpdateParameters implements JsonSerializable { + /* + * The JSON object that contains the properties of the domain to create. + */ + private AfdDomainUpdatePropertiesParameters innerProperties; + + /** + * Creates an instance of AfdDomainUpdateParameters class. + */ + public AfdDomainUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the domain to create. + * + * @return the innerProperties value. + */ + private AfdDomainUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the profileName property: The name of the profile which holds the domain. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @return the tlsSettings value. + */ + public AfdDomainHttpsParameters tlsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().tlsSettings(); + } + + /** + * Set the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @param tlsSettings the tlsSettings value to set. + * @return the AfdDomainUpdateParameters object itself. + */ + public AfdDomainUpdateParameters withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainUpdatePropertiesParameters(); + } + this.innerProperties().withTlsSettings(tlsSettings); + return this; + } + + /** + * Get the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @return the azureDnsZone value. + */ + public ResourceReference azureDnsZone() { + return this.innerProperties() == null ? null : this.innerProperties().azureDnsZone(); + } + + /** + * Set the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone the azureDnsZone value to set. + * @return the AfdDomainUpdateParameters object itself. + */ + public AfdDomainUpdateParameters withAzureDnsZone(ResourceReference azureDnsZone) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainUpdatePropertiesParameters(); + } + this.innerProperties().withAzureDnsZone(azureDnsZone); + return this; + } + + /** + * Get the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @return the preValidatedCustomDomainResourceId value. + */ + public ResourceReference preValidatedCustomDomainResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().preValidatedCustomDomainResourceId(); + } + + /** + * Set the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId the preValidatedCustomDomainResourceId value to set. + * @return the AfdDomainUpdateParameters object itself. + */ + public AfdDomainUpdateParameters + withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainUpdatePropertiesParameters(); + } + this.innerProperties().withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdDomainUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdDomainUpdateParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdDomainUpdateParameters. + */ + public static AfdDomainUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdDomainUpdateParameters deserializedAfdDomainUpdateParameters = new AfdDomainUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAfdDomainUpdateParameters.innerProperties + = AfdDomainUpdatePropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdDomainUpdateParameters; + }); + } +} 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 000000000000..88e16c99291f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoint.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import java.util.Map; + +/** + * An immutable client-side representation of AfdEndpoint. + */ +public interface AfdEndpoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value + * is TenantReuse. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the profileName property: The name of the profile which holds the endpoint. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + EnabledState enabledState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner object. + * + * @return the inner object. + */ + AfdEndpointInner innerModel(); + + /** + * The entirety of the AfdEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AfdEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AfdEndpoint definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the AfdEndpoint definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** + * The stage of the AfdEndpoint definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + + /** + * The stage of the AfdEndpoint definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAutoGeneratedDomainNameLabelScope, + DefinitionStages.WithEnabledState { + /** + * Executes the create request. + * + * @return the created resource. + */ + AfdEndpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AfdEndpoint create(Context context); + } + + /** + * The stage of the AfdEndpoint definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the AfdEndpoint definition allowing to specify autoGeneratedDomainNameLabelScope. + */ + interface WithAutoGeneratedDomainNameLabelScope { + /** + * Specifies the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The + * default value is TenantReuse.. + * + * @param autoGeneratedDomainNameLabelScope Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * @return the next definition stage. + */ + WithCreate withAutoGeneratedDomainNameLabelScope( + AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope); + } + + /** + * The stage of the AfdEndpoint definition allowing to specify enabledState. + */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + WithCreate withEnabledState(EnabledState enabledState); + } + } + + /** + * Begins update for the AfdEndpoint resource. + * + * @return the stage of resource update. + */ + AfdEndpoint.Update update(); + + /** + * The template for AfdEndpoint update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithEnabledState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AfdEndpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AfdEndpoint apply(Context context); + } + + /** + * The AfdEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the AfdEndpoint update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Endpoint tags.. + * + * @param tags Endpoint tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the AfdEndpoint update allowing to specify enabledState. + */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + Update withEnabledState(EnabledState enabledState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AfdEndpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AfdEndpoint refresh(Context context); + + /** + * Removes a content from AzureFrontDoor. + * + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeContent(AfdPurgeParameters contents); + + /** + * Removes a content from AzureFrontDoor. + * + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeContent(AfdPurgeParameters contents, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + Response + validateCustomDomainWithResponse(ValidateCustomDomainInput customDomainProperties, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointListResult.java new file mode 100644 index 000000000000..b971c03b8a53 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of AzureFrontDoor endpoints within a profile + */ + private List value; + + /* + * URL to get the next set of endpoint objects if there is any. + */ + private String nextLink; + + /** + * Creates an instance of AfdEndpointListResult class. + */ + public AfdEndpointListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor endpoints within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of endpoint objects if there is any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of endpoint objects if there is any. + * + * @param nextLink the nextLink value to set. + * @return the AfdEndpointListResult object itself. + */ + public AfdEndpointListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdEndpointListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdEndpointListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdEndpointListResult. + */ + public static AfdEndpointListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdEndpointListResult deserializedAfdEndpointListResult = new AfdEndpointListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AfdEndpointInner.fromJson(reader1)); + deserializedAfdEndpointListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAfdEndpointListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdEndpointListResult; + }); + } +} 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 000000000000..c4c415c1144a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointProtocols.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Supported protocols for the customer's endpoint. + */ +public final class AfdEndpointProtocols extends ExpandableStringEnum { + /** + * Static value Http for AfdEndpointProtocols. + */ + public static final AfdEndpointProtocols HTTP = fromString("Http"); + + /** + * Static value Https for AfdEndpointProtocols. + */ + public static final AfdEndpointProtocols HTTPS = fromString("Https"); + + /** + * Creates a new instance of AfdEndpointProtocols value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AfdEndpointProtocols() { + } + + /** + * Creates or finds a AfdEndpointProtocols from its string representation. + * + * @param name a name to look for. + * @return the corresponding AfdEndpointProtocols. + */ + public static AfdEndpointProtocols fromString(String name) { + return fromString(name, AfdEndpointProtocols.class); + } + + /** + * Gets known AfdEndpointProtocols values. + * + * @return known AfdEndpointProtocols values. + */ + public static Collection values() { + return values(AfdEndpointProtocols.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointUpdateParameters.java new file mode 100644 index 000000000000..d09972c222ae --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointUpdateParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointPropertiesUpdateParameters; +import java.io.IOException; +import java.util.Map; + +/** + * Properties required to create or update an endpoint. + */ +@Fluent +public final class AfdEndpointUpdateParameters implements JsonSerializable { + /* + * Endpoint tags. + */ + private Map tags; + + /* + * The JSON object containing endpoint update parameters. + */ + private AfdEndpointPropertiesUpdateParameters innerProperties; + + /** + * Creates an instance of AfdEndpointUpdateParameters class. + */ + public AfdEndpointUpdateParameters() { + } + + /** + * Get the tags property: Endpoint tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Endpoint tags. + * + * @param tags the tags value to set. + * @return the AfdEndpointUpdateParameters object itself. + */ + public AfdEndpointUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: The JSON object containing endpoint update parameters. + * + * @return the innerProperties value. + */ + private AfdEndpointPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the profileName property: The name of the profile which holds the endpoint. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the AfdEndpointUpdateParameters object itself. + */ + public AfdEndpointUpdateParameters withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdEndpointPropertiesUpdateParameters(); + } + this.innerProperties().withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdEndpointUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdEndpointUpdateParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdEndpointUpdateParameters. + */ + public static AfdEndpointUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdEndpointUpdateParameters deserializedAfdEndpointUpdateParameters = new AfdEndpointUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAfdEndpointUpdateParameters.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedAfdEndpointUpdateParameters.innerProperties + = AfdEndpointPropertiesUpdateParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdEndpointUpdateParameters; + }); + } +} 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 000000000000..b4ed39e9aff1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoints.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AfdEndpoints. + */ +public interface AfdEndpoints { + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + AfdEndpoint get(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeContent(String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' + * which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeContent(String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents, + Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + Response validateCustomDomainWithResponse(String resourceGroupName, String profileName, + String endpointName, ValidateCustomDomainInput customDomainProperties, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + ValidateCustomDomainOutput validateCustomDomain(String resourceGroupName, String profileName, String endpointName, + ValidateCustomDomainInput customDomainProperties); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + AfdEndpoint getById(String id); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AfdEndpoint resource. + * + * @param name resource name. + * @return the first stage of the new AfdEndpoint definition. + */ + AfdEndpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdMinimumTlsVersion.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdMinimumTlsVersion.java new file mode 100644 index 000000000000..7e1d9ac827c4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdMinimumTlsVersion.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; + +/** + * TLS protocol version that will be used for Https. + */ +public enum AfdMinimumTlsVersion { + /** + * Enum value TLS10. + */ + TLS10("TLS10"), + + /** + * Enum value TLS12. + */ + TLS12("TLS12"); + + /** + * The actual serialized value for a AfdMinimumTlsVersion instance. + */ + private final String value; + + AfdMinimumTlsVersion(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AfdMinimumTlsVersion instance. + * + * @param value the serialized value to parse. + * @return the parsed AfdMinimumTlsVersion object, or null if unable to parse. + */ + public static AfdMinimumTlsVersion fromString(String value) { + if (value == null) { + return null; + } + AfdMinimumTlsVersion[] items = AfdMinimumTlsVersion.values(); + for (AfdMinimumTlsVersion item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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 000000000000..5bf1edef5a0c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigin.java @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; + +/** + * An immutable client-side representation of AfdOrigin. + */ +public interface AfdOrigin { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the originGroupName property: The name of the origin group which contains this origin. + * + * @return the originGroupName value. + */ + String originGroupName(); + + /** + * Gets the azureOrigin property: Resource reference to the Azure origin resource. + * + * @return the azureOrigin value. + */ + ResourceReference azureOrigin(); + + /** + * Gets the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + Integer httpPort(); + + /** + * Gets the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + Integer httpsPort(); + + /** + * Gets the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @return the originHostHeader value. + */ + String originHostHeader(); + + /** + * Gets the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + Integer weight(); + + /** + * Gets the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @return the sharedPrivateLinkResource value. + */ + SharedPrivateLinkResourceProperties sharedPrivateLinkResource(); + + /** + * Gets the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @return the enabledState value. + */ + EnabledState enabledState(); + + /** + * Gets the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @return the enforceCertificateNameCheck value. + */ + Boolean enforceCertificateNameCheck(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner object. + * + * @return the inner object. + */ + AfdOriginInner innerModel(); + + /** + * The entirety of the AfdOrigin definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AfdOrigin definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AfdOrigin definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AfdOrigin definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, originGroupName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @return the next definition stage. + */ + WithCreate withExistingOriginGroup(String resourceGroupName, String profileName, String originGroupName); + } + + /** + * The stage of the AfdOrigin definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithAzureOrigin, DefinitionStages.WithHostname, + DefinitionStages.WithHttpPort, DefinitionStages.WithHttpsPort, DefinitionStages.WithOriginHostHeader, + DefinitionStages.WithPriority, DefinitionStages.WithWeight, DefinitionStages.WithSharedPrivateLinkResource, + DefinitionStages.WithEnabledState, DefinitionStages.WithEnforceCertificateNameCheck { + /** + * Executes the create request. + * + * @return the created resource. + */ + AfdOrigin create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AfdOrigin create(Context context); + } + + /** + * The stage of the AfdOrigin definition allowing to specify azureOrigin. + */ + interface WithAzureOrigin { + /** + * Specifies the azureOrigin property: Resource reference to the Azure origin resource.. + * + * @param azureOrigin Resource reference to the Azure origin resource. + * @return the next definition stage. + */ + WithCreate withAzureOrigin(ResourceReference azureOrigin); + } + + /** + * The stage of the AfdOrigin definition allowing to specify hostname. + */ + interface WithHostname { + /** + * Specifies the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 + * addresses are supported.This should be unique across all origins in an endpoint.. + * + * @param hostname The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + + /** + * The stage of the AfdOrigin definition allowing to specify httpPort. + */ + interface WithHttpPort { + /** + * Specifies the httpPort property: The value of the HTTP port. Must be between 1 and 65535.. + * + * @param httpPort The value of the HTTP port. Must be between 1 and 65535. + * @return the next definition stage. + */ + WithCreate withHttpPort(Integer httpPort); + } + + /** + * The stage of the AfdOrigin definition allowing to specify httpsPort. + */ + interface WithHttpsPort { + /** + * Specifies the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535.. + * + * @param httpsPort The value of the HTTPS port. Must be between 1 and 65535. + * @return the next definition stage. + */ + WithCreate withHttpsPort(Integer httpsPort); + } + + /** + * The stage of the AfdOrigin definition allowing to specify originHostHeader. + */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. If + * you leave this blank, the request hostname determines this value. Azure Front Door origins, such as Web + * Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by + * default. This overrides the host header defined at Endpoint. + * + * @param originHostHeader The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob + * Storage, and Cloud Services require this host header value to match the origin hostname by default. This + * overrides the host header defined at Endpoint. + * @return the next definition stage. + */ + WithCreate withOriginHostHeader(String originHostHeader); + } + + /** + * The stage of the AfdOrigin definition allowing to specify priority. + */ + interface WithPriority { + /** + * Specifies the priority property: Priority of origin in given origin group for load balancing. Higher + * priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + * and 5. + * + * @param priority Priority of origin in given origin group for load balancing. Higher priorities will not + * be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + + /** + * The stage of the AfdOrigin definition allowing to specify weight. + */ + interface WithWeight { + /** + * Specifies the weight property: Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000. + * + * @param weight Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. + * @return the next definition stage. + */ + WithCreate withWeight(Integer weight); + } + + /** + * The stage of the AfdOrigin definition allowing to specify sharedPrivateLinkResource. + */ + interface WithSharedPrivateLinkResource { + /** + * Specifies the sharedPrivateLinkResource property: The properties of the private link resource for private + * origin.. + * + * @param sharedPrivateLinkResource The properties of the private link resource for private origin. + * @return the next definition stage. + */ + WithCreate withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource); + } + + /** + * The stage of the AfdOrigin definition allowing to specify enabledState. + */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable health probes to be made against backends defined + * under backendPools. Health probes can only be disabled if there is a single enabled backend in single + * enabled backend pool.. + * + * @param enabledState Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled + * backend pool. + * @return the next definition stage. + */ + WithCreate withEnabledState(EnabledState enabledState); + } + + /** + * The stage of the AfdOrigin definition allowing to specify enforceCertificateNameCheck. + */ + interface WithEnforceCertificateNameCheck { + /** + * Specifies the enforceCertificateNameCheck property: Whether to enable certificate name check at origin + * level. + * + * @param enforceCertificateNameCheck Whether to enable certificate name check at origin level. + * @return the next definition stage. + */ + WithCreate withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck); + } + } + + /** + * Begins update for the AfdOrigin resource. + * + * @return the stage of resource update. + */ + AfdOrigin.Update update(); + + /** + * The template for AfdOrigin update. + */ + interface Update extends UpdateStages.WithAzureOrigin, UpdateStages.WithHostname, UpdateStages.WithHttpPort, + UpdateStages.WithHttpsPort, UpdateStages.WithOriginHostHeader, UpdateStages.WithPriority, + UpdateStages.WithWeight, UpdateStages.WithSharedPrivateLinkResource, UpdateStages.WithEnabledState, + UpdateStages.WithEnforceCertificateNameCheck { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AfdOrigin apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AfdOrigin apply(Context context); + } + + /** + * The AfdOrigin update stages. + */ + interface UpdateStages { + /** + * The stage of the AfdOrigin update allowing to specify azureOrigin. + */ + interface WithAzureOrigin { + /** + * Specifies the azureOrigin property: Resource reference to the Azure origin resource.. + * + * @param azureOrigin Resource reference to the Azure origin resource. + * @return the next definition stage. + */ + Update withAzureOrigin(ResourceReference azureOrigin); + } + + /** + * The stage of the AfdOrigin update allowing to specify hostname. + */ + interface WithHostname { + /** + * Specifies the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 + * addresses are supported.This should be unique across all origins in an endpoint.. + * + * @param hostname The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * @return the next definition stage. + */ + Update withHostname(String hostname); + } + + /** + * The stage of the AfdOrigin update allowing to specify httpPort. + */ + interface WithHttpPort { + /** + * Specifies the httpPort property: The value of the HTTP port. Must be between 1 and 65535.. + * + * @param httpPort The value of the HTTP port. Must be between 1 and 65535. + * @return the next definition stage. + */ + Update withHttpPort(Integer httpPort); + } + + /** + * The stage of the AfdOrigin update allowing to specify httpsPort. + */ + interface WithHttpsPort { + /** + * Specifies the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535.. + * + * @param httpsPort The value of the HTTPS port. Must be between 1 and 65535. + * @return the next definition stage. + */ + Update withHttpsPort(Integer httpsPort); + } + + /** + * The stage of the AfdOrigin update allowing to specify originHostHeader. + */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. If + * you leave this blank, the request hostname determines this value. Azure Front Door origins, such as Web + * Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by + * default. This overrides the host header defined at Endpoint. + * + * @param originHostHeader The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob + * Storage, and Cloud Services require this host header value to match the origin hostname by default. This + * overrides the host header defined at Endpoint. + * @return the next definition stage. + */ + Update withOriginHostHeader(String originHostHeader); + } + + /** + * The stage of the AfdOrigin update allowing to specify priority. + */ + interface WithPriority { + /** + * Specifies the priority property: Priority of origin in given origin group for load balancing. Higher + * priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + * and 5. + * + * @param priority Priority of origin in given origin group for load balancing. Higher priorities will not + * be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + + /** + * The stage of the AfdOrigin update allowing to specify weight. + */ + interface WithWeight { + /** + * Specifies the weight property: Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000. + * + * @param weight Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. + * @return the next definition stage. + */ + Update withWeight(Integer weight); + } + + /** + * The stage of the AfdOrigin update allowing to specify sharedPrivateLinkResource. + */ + interface WithSharedPrivateLinkResource { + /** + * Specifies the sharedPrivateLinkResource property: The properties of the private link resource for private + * origin.. + * + * @param sharedPrivateLinkResource The properties of the private link resource for private origin. + * @return the next definition stage. + */ + Update withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource); + } + + /** + * The stage of the AfdOrigin update allowing to specify enabledState. + */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable health probes to be made against backends defined + * under backendPools. Health probes can only be disabled if there is a single enabled backend in single + * enabled backend pool.. + * + * @param enabledState Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled + * backend pool. + * @return the next definition stage. + */ + Update withEnabledState(EnabledState enabledState); + } + + /** + * The stage of the AfdOrigin update allowing to specify enforceCertificateNameCheck. + */ + interface WithEnforceCertificateNameCheck { + /** + * Specifies the enforceCertificateNameCheck property: Whether to enable certificate name check at origin + * level. + * + * @param enforceCertificateNameCheck Whether to enable certificate name check at origin level. + * @return the next definition stage. + */ + Update withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AfdOrigin refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AfdOrigin refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroup.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroup.java new file mode 100644 index 000000000000..35b5dce6ba5f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroup.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; + +/** + * An immutable client-side representation of AfdOriginGroup. + */ +public interface AfdOriginGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the profileName property: The name of the profile which holds the origin group. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + LoadBalancingSettingsParameters loadBalancingSettings(); + + /** + * Gets the healthProbeSettings property: Health probe settings to the origin that is used to determine the health + * of the origin. + * + * @return the healthProbeSettings value. + */ + HealthProbeParameters healthProbeSettings(); + + /** + * Gets the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + + /** + * Gets the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityState value. + */ + EnabledState sessionAffinityState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner object. + * + * @return the inner object. + */ + AfdOriginGroupInner innerModel(); + + /** + * The entirety of the AfdOriginGroup definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AfdOriginGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AfdOriginGroup definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AfdOriginGroup definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + + /** + * The stage of the AfdOriginGroup definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLoadBalancingSettings, DefinitionStages.WithHealthProbeSettings, + DefinitionStages.WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes, + DefinitionStages.WithSessionAffinityState { + /** + * Executes the create request. + * + * @return the created resource. + */ + AfdOriginGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AfdOriginGroup create(Context context); + } + + /** + * The stage of the AfdOriginGroup definition allowing to specify loadBalancingSettings. + */ + interface WithLoadBalancingSettings { + /** + * Specifies the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings Load balancing settings for a backend pool. + * @return the next definition stage. + */ + WithCreate withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings); + } + + /** + * The stage of the AfdOriginGroup definition allowing to specify healthProbeSettings. + */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings to the origin that is used to determine + * the health of the origin.. + * + * @param healthProbeSettings Health probe settings to the origin that is used to determine the health of + * the origin. + * @return the next definition stage. + */ + WithCreate withHealthProbeSettings(HealthProbeParameters healthProbeSettings); + } + + /** + * The stage of the AfdOriginGroup definition allowing to specify + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes. + */ + interface WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes { + /** + * Specifies the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift + * the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is + * added. Default is 10 mins. This property is currently not supported.. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes Time in minutes to shift the traffic to the + * endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 + * mins. This property is currently not supported. + * @return the next definition stage. + */ + WithCreate withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + } + + /** + * The stage of the AfdOriginGroup definition allowing to specify sessionAffinityState. + */ + interface WithSessionAffinityState { + /** + * Specifies the sessionAffinityState property: Whether to allow session affinity on this host. Valid + * options are 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. + * @return the next definition stage. + */ + WithCreate withSessionAffinityState(EnabledState sessionAffinityState); + } + } + + /** + * Begins update for the AfdOriginGroup resource. + * + * @return the stage of resource update. + */ + AfdOriginGroup.Update update(); + + /** + * The template for AfdOriginGroup update. + */ + interface Update extends UpdateStages.WithLoadBalancingSettings, UpdateStages.WithHealthProbeSettings, + UpdateStages.WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes, UpdateStages.WithSessionAffinityState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AfdOriginGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AfdOriginGroup apply(Context context); + } + + /** + * The AfdOriginGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the AfdOriginGroup update allowing to specify loadBalancingSettings. + */ + interface WithLoadBalancingSettings { + /** + * Specifies the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings Load balancing settings for a backend pool. + * @return the next definition stage. + */ + Update withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings); + } + + /** + * The stage of the AfdOriginGroup update allowing to specify healthProbeSettings. + */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings to the origin that is used to determine + * the health of the origin.. + * + * @param healthProbeSettings Health probe settings to the origin that is used to determine the health of + * the origin. + * @return the next definition stage. + */ + Update withHealthProbeSettings(HealthProbeParameters healthProbeSettings); + } + + /** + * The stage of the AfdOriginGroup update allowing to specify + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes. + */ + interface WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes { + /** + * Specifies the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift + * the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is + * added. Default is 10 mins. This property is currently not supported.. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes Time in minutes to shift the traffic to the + * endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 + * mins. This property is currently not supported. + * @return the next definition stage. + */ + Update withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + } + + /** + * The stage of the AfdOriginGroup update allowing to specify sessionAffinityState. + */ + interface WithSessionAffinityState { + /** + * Specifies the sessionAffinityState property: Whether to allow session affinity on this host. Valid + * options are 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. + * @return the next definition stage. + */ + Update withSessionAffinityState(EnabledState sessionAffinityState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AfdOriginGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AfdOriginGroup refresh(Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupListResult.java new file mode 100644 index 000000000000..ad66a1b8a8bf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupListResult.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of Azure Front Door origin groups within an Azure Front Door endpoint + */ + private List value; + + /* + * URL to get the next set of origin objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of AfdOriginGroupListResult class. + */ + public AfdOriginGroupListResult() { + } + + /** + * Get the value property: List of Azure Front Door origin groups within an Azure Front Door endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of origin objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of origin objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the AfdOriginGroupListResult object itself. + */ + public AfdOriginGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginGroupListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdOriginGroupListResult. + */ + public static AfdOriginGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginGroupListResult deserializedAfdOriginGroupListResult = new AfdOriginGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AfdOriginGroupInner.fromJson(reader1)); + deserializedAfdOriginGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAfdOriginGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginGroupListResult; + }); + } +} 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 000000000000..dda1b9563744 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdateParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupUpdatePropertiesParameters; +import java.io.IOException; + +/** + * AFDOrigin group properties needed for origin group creation or update. + */ +@Fluent +public final class AfdOriginGroupUpdateParameters implements JsonSerializable { + /* + * The JSON object that contains the properties of the origin group. + */ + private AfdOriginGroupUpdatePropertiesParameters innerProperties; + + /** + * Creates an instance of AfdOriginGroupUpdateParameters class. + */ + public AfdOriginGroupUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin group. + * + * @return the innerProperties value. + */ + private AfdOriginGroupUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the profileName property: The name of the profile which holds the origin group. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + public LoadBalancingSettingsParameters loadBalancingSettings() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancingSettings(); + } + + /** + * Set the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters + withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withLoadBalancingSettings(loadBalancingSettings); + return this; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupUpdatePropertiesParameters(); + } + this.innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityState value. + */ + public EnabledState sessionAffinityState() { + return this.innerProperties() == null ? null : this.innerProperties().sessionAffinityState(); + } + + /** + * Set the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState the sessionAffinityState value to set. + * @return the AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters withSessionAffinityState(EnabledState sessionAffinityState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withSessionAffinityState(sessionAffinityState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginGroupUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginGroupUpdateParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdOriginGroupUpdateParameters. + */ + public static AfdOriginGroupUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginGroupUpdateParameters deserializedAfdOriginGroupUpdateParameters + = new AfdOriginGroupUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAfdOriginGroupUpdateParameters.innerProperties + = AfdOriginGroupUpdatePropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginGroupUpdateParameters; + }); + } +} 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 000000000000..952b55464767 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroups.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AfdOriginGroups. + */ +public interface AfdOriginGroups { + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String originGroupName, + Context context); + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile. + */ + AfdOriginGroup get(String resourceGroupName, String profileName, String originGroupName); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String originGroupName); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String originGroupName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String originGroupName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String originGroupName, + Context context); + + /** + * Gets an existing origin group within a profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response}. + */ + AfdOriginGroup getById(String id); + + /** + * Gets an existing origin group within a profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing origin group within a profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing origin group within a profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AfdOriginGroup resource. + * + * @param name resource name. + * @return the first stage of the new AfdOriginGroup definition. + */ + AfdOriginGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginListResult.java new file mode 100644 index 000000000000..d997d7a24fe4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of Azure Front Door origins within an Azure Front Door endpoint + */ + private List value; + + /* + * URL to get the next set of origin objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of AfdOriginListResult class. + */ + public AfdOriginListResult() { + } + + /** + * Get the value property: List of Azure Front Door origins within an Azure Front Door endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of origin objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of origin objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the AfdOriginListResult object itself. + */ + public AfdOriginListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdOriginListResult. + */ + public static AfdOriginListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginListResult deserializedAfdOriginListResult = new AfdOriginListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AfdOriginInner.fromJson(reader1)); + deserializedAfdOriginListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAfdOriginListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginListResult; + }); + } +} 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 000000000000..1a9e2e1487ba --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdateParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginUpdatePropertiesParameters; +import java.io.IOException; + +/** + * AFDOrigin properties needed for origin update. + */ +@Fluent +public final class AfdOriginUpdateParameters implements JsonSerializable { + /* + * The JSON object that contains the properties of the origin. + */ + private AfdOriginUpdatePropertiesParameters innerProperties; + + /** + * Creates an instance of AfdOriginUpdateParameters class. + */ + public AfdOriginUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin. + * + * @return the innerProperties value. + */ + private AfdOriginUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the originGroupName property: The name of the origin group which contains this origin. + * + * @return the originGroupName value. + */ + public String originGroupName() { + return this.innerProperties() == null ? null : this.innerProperties().originGroupName(); + } + + /** + * Get the azureOrigin property: Resource reference to the Azure origin resource. + * + * @return the azureOrigin value. + */ + public ResourceReference azureOrigin() { + return this.innerProperties() == null ? null : this.innerProperties().azureOrigin(); + } + + /** + * Set the azureOrigin property: Resource reference to the Azure origin resource. + * + * @param azureOrigin the azureOrigin value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withAzureOrigin(ResourceReference azureOrigin) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withAzureOrigin(azureOrigin); + return this; + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @return the sharedPrivateLinkResource value. + */ + public SharedPrivateLinkResourceProperties sharedPrivateLinkResource() { + return this.innerProperties() == null ? null : this.innerProperties().sharedPrivateLinkResource(); + } + + /** + * Set the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @param sharedPrivateLinkResource the sharedPrivateLinkResource value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters + withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } + + /** + * Get the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @param enabledState the enabledState value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withEnabledState(enabledState); + return this; + } + + /** + * Get the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @return the enforceCertificateNameCheck value. + */ + public Boolean enforceCertificateNameCheck() { + return this.innerProperties() == null ? null : this.innerProperties().enforceCertificateNameCheck(); + } + + /** + * Set the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @param enforceCertificateNameCheck the enforceCertificateNameCheck value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withEnforceCertificateNameCheck(enforceCertificateNameCheck); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdOriginUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdOriginUpdateParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdOriginUpdateParameters. + */ + public static AfdOriginUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdOriginUpdateParameters deserializedAfdOriginUpdateParameters = new AfdOriginUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAfdOriginUpdateParameters.innerProperties + = AfdOriginUpdatePropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdOriginUpdateParameters; + }); + } +} 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 000000000000..dbde5ebbe486 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigins.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AfdOrigins. + */ +public interface AfdOrigins { + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOriginGroup(String resourceGroupName, String profileName, String originGroupName); + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOriginGroup(String resourceGroupName, String profileName, String originGroupName, + Context context); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String originGroupName, + String originName, Context context); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group. + */ + AfdOrigin get(String resourceGroupName, String profileName, String originGroupName, String originName); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String originGroupName, String originName); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String originGroupName, String originName, + Context context); + + /** + * Gets an existing origin within an origin group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response}. + */ + AfdOrigin getById(String id); + + /** + * Gets an existing origin within an origin group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing origin within an origin group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing origin within an origin group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AfdOrigin resource. + * + * @param name resource name. + * @return the first stage of the new AfdOrigin definition. + */ + AfdOrigin.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProfiles.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProfiles.java new file mode 100644 index 000000000000..731dab1333e7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProfiles.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AfdProfiles. + */ +public interface AfdProfiles { + /** + * Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + Response checkEndpointNameAvailabilityWithResponse(String resourceGroupName, + String profileName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, Context context); + + /** + * Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + CheckEndpointNameAvailabilityOutput checkEndpointNameAvailability(String resourceGroupName, String profileName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + Response checkHostnameAvailabilityWithResponse(String resourceGroupName, + String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + CheckNameAvailabilityOutput checkHostnameAvailability(String resourceGroupName, String profileName, + CheckHostnameAvailabilityInput checkHostnameAvailabilityInput); + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret along with {@link Response}. + */ + Response validateSecretWithResponse(String resourceGroupName, String profileName, + ValidateSecretInput validateSecretInput, Context context); + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret. + */ + ValidateSecretOutput validateSecret(String resourceGroupName, String profileName, + ValidateSecretInput validateSecretInput); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + Profile upgrade(String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + Profile upgrade(String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters, + Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProvisioningState.java new file mode 100644 index 000000000000..665d9342947a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning status. + */ +public final class AfdProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for AfdProvisioningState. + */ + public static final AfdProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for AfdProvisioningState. + */ + public static final AfdProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Updating for AfdProvisioningState. + */ + public static final AfdProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for AfdProvisioningState. + */ + public static final AfdProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Creating for AfdProvisioningState. + */ + public static final AfdProvisioningState CREATING = fromString("Creating"); + + /** + * Creates a new instance of AfdProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AfdProvisioningState() { + } + + /** + * Creates or finds a AfdProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AfdProvisioningState. + */ + public static AfdProvisioningState fromString(String name) { + return fromString(name, AfdProvisioningState.class); + } + + /** + * Gets known AfdProvisioningState values. + * + * @return known AfdProvisioningState values. + */ + public static Collection values() { + return values(AfdProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdPurgeParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdPurgeParameters.java new file mode 100644 index 000000000000..fd57e0615666 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdPurgeParameters.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters required for content purge. + */ +@Fluent +public final class AfdPurgeParameters implements JsonSerializable { + /* + * The path to the content to be purged. Can describe a file path or a wild card directory. + */ + private List contentPaths; + + /* + * List of domains. + */ + private List domains; + + /** + * Creates an instance of AfdPurgeParameters class. + */ + public AfdPurgeParameters() { + } + + /** + * Get the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @return the contentPaths value. + */ + public List contentPaths() { + return this.contentPaths; + } + + /** + * Set the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @param contentPaths the contentPaths value to set. + * @return the AfdPurgeParameters object itself. + */ + public AfdPurgeParameters withContentPaths(List contentPaths) { + this.contentPaths = contentPaths; + return this; + } + + /** + * Get the domains property: List of domains. + * + * @return the domains value. + */ + public List domains() { + return this.domains; + } + + /** + * Set the domains property: List of domains. + * + * @param domains the domains value to set. + * @return the AfdPurgeParameters object itself. + */ + public AfdPurgeParameters withDomains(List domains) { + this.domains = domains; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentPaths() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property contentPaths in model AfdPurgeParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AfdPurgeParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("contentPaths", this.contentPaths, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("domains", this.domains, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdPurgeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdPurgeParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AfdPurgeParameters. + */ + public static AfdPurgeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdPurgeParameters deserializedAfdPurgeParameters = new AfdPurgeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentPaths".equals(fieldName)) { + List contentPaths = reader.readArray(reader1 -> reader1.getString()); + deserializedAfdPurgeParameters.contentPaths = contentPaths; + } else if ("domains".equals(fieldName)) { + List domains = reader.readArray(reader1 -> reader1.getString()); + deserializedAfdPurgeParameters.domains = domains; + } else { + reader.skipChildren(); + } + } + + return deserializedAfdPurgeParameters; + }); + } +} 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 000000000000..6b02ff6c39f5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdQueryStringCachingBehavior.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 java.util.Collection; + +/** + * Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, + * ignore specific query strings, cache every request with a unique URL, or cache specific query strings. + */ +public final class AfdQueryStringCachingBehavior extends ExpandableStringEnum { + /** + * Static value IgnoreQueryString for AfdQueryStringCachingBehavior. + */ + public static final AfdQueryStringCachingBehavior IGNORE_QUERY_STRING = fromString("IgnoreQueryString"); + + /** + * Static value UseQueryString for AfdQueryStringCachingBehavior. + */ + public static final AfdQueryStringCachingBehavior USE_QUERY_STRING = fromString("UseQueryString"); + + /** + * Static value IgnoreSpecifiedQueryStrings for AfdQueryStringCachingBehavior. + */ + public static final AfdQueryStringCachingBehavior IGNORE_SPECIFIED_QUERY_STRINGS + = fromString("IgnoreSpecifiedQueryStrings"); + + /** + * Static value IncludeSpecifiedQueryStrings for AfdQueryStringCachingBehavior. + */ + public static final AfdQueryStringCachingBehavior INCLUDE_SPECIFIED_QUERY_STRINGS + = fromString("IncludeSpecifiedQueryStrings"); + + /** + * Creates a new instance of AfdQueryStringCachingBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AfdQueryStringCachingBehavior() { + } + + /** + * Creates or finds a AfdQueryStringCachingBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding AfdQueryStringCachingBehavior. + */ + public static AfdQueryStringCachingBehavior fromString(String name) { + return fromString(name, AfdQueryStringCachingBehavior.class); + } + + /** + * Gets known AfdQueryStringCachingBehavior values. + * + * @return known AfdQueryStringCachingBehavior values. + */ + public static Collection values() { + return values(AfdQueryStringCachingBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdRouteCacheConfiguration.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdRouteCacheConfiguration.java new file mode 100644 index 000000000000..03542124597a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdRouteCacheConfiguration.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Caching settings for a caching-type route. To disable caching, do not provide a cacheConfiguration object. + */ +@Fluent +public final class AfdRouteCacheConfiguration implements JsonSerializable { + /* + * Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, + * ignore specific query strings, cache every request with a unique URL, or cache specific query strings. + */ + private AfdQueryStringCachingBehavior queryStringCachingBehavior; + + /* + * query parameters to include or exclude (comma separated). + */ + private String queryParameters; + + /* + * compression settings. + */ + private CompressionSettings compressionSettings; + + /** + * Creates an instance of AfdRouteCacheConfiguration class. + */ + public AfdRouteCacheConfiguration() { + } + + /** + * Get the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. + * You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique + * URL, or cache specific query strings. + * + * @return the queryStringCachingBehavior value. + */ + public AfdQueryStringCachingBehavior queryStringCachingBehavior() { + return this.queryStringCachingBehavior; + } + + /** + * Set the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. + * You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique + * URL, or cache specific query strings. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the AfdRouteCacheConfiguration object itself. + */ + public AfdRouteCacheConfiguration + withQueryStringCachingBehavior(AfdQueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + return this; + } + + /** + * Get the queryParameters property: query parameters to include or exclude (comma separated). + * + * @return the queryParameters value. + */ + public String queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: query parameters to include or exclude (comma separated). + * + * @param queryParameters the queryParameters value to set. + * @return the AfdRouteCacheConfiguration object itself. + */ + public AfdRouteCacheConfiguration withQueryParameters(String queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Get the compressionSettings property: compression settings. + * + * @return the compressionSettings value. + */ + public CompressionSettings compressionSettings() { + return this.compressionSettings; + } + + /** + * Set the compressionSettings property: compression settings. + * + * @param compressionSettings the compressionSettings value to set. + * @return the AfdRouteCacheConfiguration object itself. + */ + public AfdRouteCacheConfiguration withCompressionSettings(CompressionSettings compressionSettings) { + this.compressionSettings = compressionSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (compressionSettings() != null) { + compressionSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("queryStringCachingBehavior", + this.queryStringCachingBehavior == null ? null : this.queryStringCachingBehavior.toString()); + jsonWriter.writeStringField("queryParameters", this.queryParameters); + jsonWriter.writeJsonField("compressionSettings", this.compressionSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdRouteCacheConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdRouteCacheConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdRouteCacheConfiguration. + */ + public static AfdRouteCacheConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdRouteCacheConfiguration deserializedAfdRouteCacheConfiguration = new AfdRouteCacheConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("queryStringCachingBehavior".equals(fieldName)) { + deserializedAfdRouteCacheConfiguration.queryStringCachingBehavior + = AfdQueryStringCachingBehavior.fromString(reader.getString()); + } else if ("queryParameters".equals(fieldName)) { + deserializedAfdRouteCacheConfiguration.queryParameters = reader.getString(); + } else if ("compressionSettings".equals(fieldName)) { + deserializedAfdRouteCacheConfiguration.compressionSettings = CompressionSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdRouteCacheConfiguration; + }); + } +} 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 000000000000..1134e58fe377 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdStateProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The tracking states for afd resources. + */ +@Immutable +public class AfdStateProperties implements JsonSerializable { + /* + * Provisioning status + */ + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + private DeploymentStatus deploymentStatus; + + /** + * Creates an instance of AfdStateProperties class. + */ + public AfdStateProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning status. + * + * @param provisioningState the provisioningState value to set. + * @return the AfdStateProperties object itself. + */ + AfdStateProperties withProvisioningState(AfdProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Set the deploymentStatus property: The deploymentStatus property. + * + * @param deploymentStatus the deploymentStatus value to set. + * @return the AfdStateProperties object itself. + */ + AfdStateProperties withDeploymentStatus(DeploymentStatus deploymentStatus) { + this.deploymentStatus = deploymentStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AfdStateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AfdStateProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AfdStateProperties. + */ + public static AfdStateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AfdStateProperties deserializedAfdStateProperties = new AfdStateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedAfdStateProperties.provisioningState + = AfdProvisioningState.fromString(reader.getString()); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedAfdStateProperties.deploymentStatus = DeploymentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAfdStateProperties; + }); + } +} 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 000000000000..be438c244f2a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Algorithm.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 java.util.Collection; + +/** + * Algorithm to use for URL signing. + */ +public final class Algorithm extends ExpandableStringEnum { + /** + * Static value SHA256 for Algorithm. + */ + public static final Algorithm SHA256 = fromString("SHA256"); + + /** + * Creates a new instance of Algorithm value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Algorithm() { + } + + /** + * Creates or finds a Algorithm from its string representation. + * + * @param name a name to look for. + * @return the corresponding Algorithm. + */ + public static Algorithm fromString(String name) { + return fromString(name, Algorithm.class); + } + + /** + * Gets known Algorithm values. + * + * @return known Algorithm values. + */ + public static Collection values() { + return values(Algorithm.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AutoGeneratedDomainNameLabelScope.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AutoGeneratedDomainNameLabelScope.java new file mode 100644 index 000000000000..51ef76ace58e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AutoGeneratedDomainNameLabelScope.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 java.util.Collection; + +/** + * Indicates the endpoint name reuse scope. The default value is TenantReuse. + */ +public final class AutoGeneratedDomainNameLabelScope extends ExpandableStringEnum { + /** + * Static value TenantReuse for AutoGeneratedDomainNameLabelScope. + */ + public static final AutoGeneratedDomainNameLabelScope TENANT_REUSE = fromString("TenantReuse"); + + /** + * Static value SubscriptionReuse for AutoGeneratedDomainNameLabelScope. + */ + public static final AutoGeneratedDomainNameLabelScope SUBSCRIPTION_REUSE = fromString("SubscriptionReuse"); + + /** + * Static value ResourceGroupReuse for AutoGeneratedDomainNameLabelScope. + */ + public static final AutoGeneratedDomainNameLabelScope RESOURCE_GROUP_REUSE = fromString("ResourceGroupReuse"); + + /** + * Static value NoReuse for AutoGeneratedDomainNameLabelScope. + */ + public static final AutoGeneratedDomainNameLabelScope NO_REUSE = fromString("NoReuse"); + + /** + * Creates a new instance of AutoGeneratedDomainNameLabelScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoGeneratedDomainNameLabelScope() { + } + + /** + * Creates or finds a AutoGeneratedDomainNameLabelScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoGeneratedDomainNameLabelScope. + */ + public static AutoGeneratedDomainNameLabelScope fromString(String name) { + return fromString(name, AutoGeneratedDomainNameLabelScope.class); + } + + /** + * Gets known AutoGeneratedDomainNameLabelScope values. + * + * @return known AutoGeneratedDomainNameLabelScope values. + */ + public static Collection values() { + return values(AutoGeneratedDomainNameLabelScope.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificate.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificate.java new file mode 100644 index 000000000000..6b5de9ab35cf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificate.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure FirstParty Managed Certificate provided by other first party resource providers to enable HTTPS. + */ +@Fluent +public final class AzureFirstPartyManagedCertificate extends Certificate { + /* + * Certificate expiration date. + */ + private String expirationDate; + + /* + * Subject name in the certificate. + */ + private String subject; + + /** + * Creates an instance of AzureFirstPartyManagedCertificate class. + */ + public AzureFirstPartyManagedCertificate() { + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + @Override + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + @Override + public String subject() { + return this.subject; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureFirstPartyManagedCertificate withType(SecretType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirstPartyManagedCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirstPartyManagedCertificate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirstPartyManagedCertificate. + */ + public static AzureFirstPartyManagedCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirstPartyManagedCertificate deserializedAzureFirstPartyManagedCertificate + = new AzureFirstPartyManagedCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAzureFirstPartyManagedCertificate.withType(SecretType.fromString(reader.getString())); + } else if ("subject".equals(fieldName)) { + deserializedAzureFirstPartyManagedCertificate.subject = reader.getString(); + } else if ("expirationDate".equals(fieldName)) { + deserializedAzureFirstPartyManagedCertificate.expirationDate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirstPartyManagedCertificate; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificateParameters.java new file mode 100644 index 000000000000..317e8424a3be --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificateParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Azure FirstParty Managed Certificate provided by other first party resource providers to enable HTTPS. + */ +@Fluent +public final class AzureFirstPartyManagedCertificateParameters extends SecretParameters { + /* + * The type of the secret resource. + */ + private SecretType type = SecretType.AZURE_FIRST_PARTY_MANAGED_CERTIFICATE; + + /* + * Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + */ + private ResourceReference secretSource; + + /* + * Subject name in the certificate. + */ + private String subject; + + /* + * Certificate expiration date. + */ + private String expirationDate; + + /* + * Certificate issuing authority. + */ + private String certificateAuthority; + + /* + * The list of SANs. + */ + private List subjectAlternativeNames; + + /* + * Certificate thumbprint. + */ + private String thumbprint; + + /** + * Creates an instance of AzureFirstPartyManagedCertificateParameters class. + */ + public AzureFirstPartyManagedCertificateParameters() { + } + + /** + * Get the type property: The type of the secret resource. + * + * @return the type value. + */ + @Override + public SecretType type() { + return this.type; + } + + /** + * Get the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the certificateAuthority property: Certificate issuing authority. + * + * @return the certificateAuthority value. + */ + public String certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Get the subjectAlternativeNames property: The list of SANs. + * + * @return the subjectAlternativeNames value. + */ + public List subjectAlternativeNames() { + return this.subjectAlternativeNames; + } + + /** + * Set the subjectAlternativeNames property: The list of SANs. + * + * @param subjectAlternativeNames the subjectAlternativeNames value to set. + * @return the AzureFirstPartyManagedCertificateParameters object itself. + */ + public AzureFirstPartyManagedCertificateParameters + withSubjectAlternativeNames(List subjectAlternativeNames) { + this.subjectAlternativeNames = subjectAlternativeNames; + return this; + } + + /** + * Get the thumbprint property: Certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (secretSource() != null) { + secretSource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("subjectAlternativeNames", this.subjectAlternativeNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirstPartyManagedCertificateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirstPartyManagedCertificateParameters if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirstPartyManagedCertificateParameters. + */ + public static AzureFirstPartyManagedCertificateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirstPartyManagedCertificateParameters deserializedAzureFirstPartyManagedCertificateParameters + = new AzureFirstPartyManagedCertificateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAzureFirstPartyManagedCertificateParameters.type + = SecretType.fromString(reader.getString()); + } else if ("secretSource".equals(fieldName)) { + deserializedAzureFirstPartyManagedCertificateParameters.secretSource + = ResourceReference.fromJson(reader); + } else if ("subject".equals(fieldName)) { + deserializedAzureFirstPartyManagedCertificateParameters.subject = reader.getString(); + } else if ("expirationDate".equals(fieldName)) { + deserializedAzureFirstPartyManagedCertificateParameters.expirationDate = reader.getString(); + } else if ("certificateAuthority".equals(fieldName)) { + deserializedAzureFirstPartyManagedCertificateParameters.certificateAuthority = reader.getString(); + } else if ("subjectAlternativeNames".equals(fieldName)) { + List subjectAlternativeNames = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirstPartyManagedCertificateParameters.subjectAlternativeNames + = subjectAlternativeNames; + } else if ("thumbprint".equals(fieldName)) { + deserializedAzureFirstPartyManagedCertificateParameters.thumbprint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirstPartyManagedCertificateParameters; + }); + } +} 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 000000000000..fa771a785e23 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheBehavior.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Caching behavior for the requests. + */ +public final class CacheBehavior extends ExpandableStringEnum { + /** + * Static value BypassCache for CacheBehavior. + */ + public static final CacheBehavior BYPASS_CACHE = fromString("BypassCache"); + + /** + * Static value Override for CacheBehavior. + */ + public static final CacheBehavior OVERRIDE = fromString("Override"); + + /** + * Static value SetIfMissing for CacheBehavior. + */ + public static final CacheBehavior SET_IF_MISSING = fromString("SetIfMissing"); + + /** + * Creates a new instance of CacheBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CacheBehavior() { + } + + /** + * Creates or finds a CacheBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding CacheBehavior. + */ + public static CacheBehavior fromString(String name) { + return fromString(name, CacheBehavior.class); + } + + /** + * Gets known CacheBehavior values. + * + * @return known CacheBehavior values. + */ + public static Collection values() { + return values(CacheBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheConfiguration.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheConfiguration.java new file mode 100644 index 000000000000..5856aaa0e4db --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Caching settings for a caching-type route. To disable caching, do not provide a cacheConfiguration object. + */ +@Fluent +public final class CacheConfiguration implements JsonSerializable { + /* + * Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, + * ignore specific query strings, cache every request with a unique URL, or cache specific query strings. + */ + private RuleQueryStringCachingBehavior queryStringCachingBehavior; + + /* + * query parameters to include or exclude (comma separated). + */ + private String queryParameters; + + /* + * Indicates whether content compression is enabled. If compression is enabled, content will be served as compressed + * if user requests for a compressed version. Content won't be compressed on AzureFrontDoor when requested content + * is smaller than 1 byte or larger than 1 MB. + */ + private RuleIsCompressionEnabled isCompressionEnabled; + + /* + * Caching behavior for the requests + */ + private RuleCacheBehavior cacheBehavior; + + /* + * The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss + */ + private String cacheDuration; + + /** + * Creates an instance of CacheConfiguration class. + */ + public CacheConfiguration() { + } + + /** + * Get the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. + * You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique + * URL, or cache specific query strings. + * + * @return the queryStringCachingBehavior value. + */ + public RuleQueryStringCachingBehavior queryStringCachingBehavior() { + return this.queryStringCachingBehavior; + } + + /** + * Set the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. + * You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique + * URL, or cache specific query strings. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration + withQueryStringCachingBehavior(RuleQueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + return this; + } + + /** + * Get the queryParameters property: query parameters to include or exclude (comma separated). + * + * @return the queryParameters value. + */ + public String queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: query parameters to include or exclude (comma separated). + * + * @param queryParameters the queryParameters value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withQueryParameters(String queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled. If compression is + * enabled, content will be served as compressed if user requests for a compressed version. Content won't be + * compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public RuleIsCompressionEnabled isCompressionEnabled() { + return this.isCompressionEnabled; + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled. If compression is + * enabled, content will be served as compressed if user requests for a compressed version. Content won't be + * compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withIsCompressionEnabled(RuleIsCompressionEnabled isCompressionEnabled) { + this.isCompressionEnabled = isCompressionEnabled; + return this; + } + + /** + * Get the cacheBehavior property: Caching behavior for the requests. + * + * @return the cacheBehavior value. + */ + public RuleCacheBehavior cacheBehavior() { + return this.cacheBehavior; + } + + /** + * Set the cacheBehavior property: Caching behavior for the requests. + * + * @param cacheBehavior the cacheBehavior value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withCacheBehavior(RuleCacheBehavior cacheBehavior) { + this.cacheBehavior = cacheBehavior; + return this; + } + + /** + * Get the cacheDuration property: The duration for which the content needs to be cached. Allowed format is + * [d.]hh:mm:ss. + * + * @return the cacheDuration value. + */ + public String cacheDuration() { + return this.cacheDuration; + } + + /** + * Set the cacheDuration property: The duration for which the content needs to be cached. Allowed format is + * [d.]hh:mm:ss. + * + * @param cacheDuration the cacheDuration value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withCacheDuration(String cacheDuration) { + this.cacheDuration = cacheDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("queryStringCachingBehavior", + this.queryStringCachingBehavior == null ? null : this.queryStringCachingBehavior.toString()); + jsonWriter.writeStringField("queryParameters", this.queryParameters); + jsonWriter.writeStringField("isCompressionEnabled", + this.isCompressionEnabled == null ? null : this.isCompressionEnabled.toString()); + jsonWriter.writeStringField("cacheBehavior", this.cacheBehavior == null ? null : this.cacheBehavior.toString()); + jsonWriter.writeStringField("cacheDuration", this.cacheDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CacheConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CacheConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CacheConfiguration. + */ + public static CacheConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CacheConfiguration deserializedCacheConfiguration = new CacheConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("queryStringCachingBehavior".equals(fieldName)) { + deserializedCacheConfiguration.queryStringCachingBehavior + = RuleQueryStringCachingBehavior.fromString(reader.getString()); + } else if ("queryParameters".equals(fieldName)) { + deserializedCacheConfiguration.queryParameters = reader.getString(); + } else if ("isCompressionEnabled".equals(fieldName)) { + deserializedCacheConfiguration.isCompressionEnabled + = RuleIsCompressionEnabled.fromString(reader.getString()); + } else if ("cacheBehavior".equals(fieldName)) { + deserializedCacheConfiguration.cacheBehavior = RuleCacheBehavior.fromString(reader.getString()); + } else if ("cacheDuration".equals(fieldName)) { + deserializedCacheConfiguration.cacheDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCacheConfiguration; + }); + } +} 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 000000000000..998c0d315755 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheExpirationActionParameters.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for the cache expiration action. + */ +@Fluent +public final class CacheExpirationActionParameters extends DeliveryRuleActionParameters { + /* + * The typeName property. + */ + private DeliveryRuleActionParametersType typeName + = DeliveryRuleActionParametersType.DELIVERY_RULE_CACHE_EXPIRATION_ACTION_PARAMETERS; + + /* + * Caching behavior for the requests + */ + private CacheBehavior cacheBehavior; + + /* + * The level at which the content needs to be cached. + */ + private CacheType cacheType; + + /* + * The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss + */ + private String cacheDuration; + + /** + * Creates an instance of CacheExpirationActionParameters class. + */ + public CacheExpirationActionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleActionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (cacheBehavior() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property cacheBehavior in model CacheExpirationActionParameters")); + } + if (cacheType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property cacheType in model CacheExpirationActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CacheExpirationActionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cacheBehavior", this.cacheBehavior == null ? null : this.cacheBehavior.toString()); + jsonWriter.writeStringField("cacheType", this.cacheType == null ? null : this.cacheType.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("cacheDuration", this.cacheDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CacheExpirationActionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CacheExpirationActionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CacheExpirationActionParameters. + */ + public static CacheExpirationActionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CacheExpirationActionParameters deserializedCacheExpirationActionParameters + = new CacheExpirationActionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cacheBehavior".equals(fieldName)) { + deserializedCacheExpirationActionParameters.cacheBehavior + = CacheBehavior.fromString(reader.getString()); + } else if ("cacheType".equals(fieldName)) { + deserializedCacheExpirationActionParameters.cacheType = CacheType.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedCacheExpirationActionParameters.typeName + = DeliveryRuleActionParametersType.fromString(reader.getString()); + } else if ("cacheDuration".equals(fieldName)) { + deserializedCacheExpirationActionParameters.cacheDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCacheExpirationActionParameters; + }); + } +} 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 000000000000..b97420706050 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheKeyQueryStringActionParameters.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for the cache-key query string action. + */ +@Fluent +public final class CacheKeyQueryStringActionParameters extends DeliveryRuleActionParameters { + /* + * The typeName property. + */ + private DeliveryRuleActionParametersType typeName + = DeliveryRuleActionParametersType.DELIVERY_RULE_CACHE_KEY_QUERY_STRING_BEHAVIOR_ACTION_PARAMETERS; + + /* + * Caching behavior for the requests + */ + private QueryStringBehavior queryStringBehavior; + + /* + * query parameters to include or exclude (comma separated). + */ + private String queryParameters; + + /** + * Creates an instance of CacheKeyQueryStringActionParameters class. + */ + public CacheKeyQueryStringActionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleActionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (queryStringBehavior() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property queryStringBehavior in model CacheKeyQueryStringActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CacheKeyQueryStringActionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("queryStringBehavior", + this.queryStringBehavior == null ? null : this.queryStringBehavior.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("queryParameters", this.queryParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CacheKeyQueryStringActionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CacheKeyQueryStringActionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CacheKeyQueryStringActionParameters. + */ + public static CacheKeyQueryStringActionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CacheKeyQueryStringActionParameters deserializedCacheKeyQueryStringActionParameters + = new CacheKeyQueryStringActionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("queryStringBehavior".equals(fieldName)) { + deserializedCacheKeyQueryStringActionParameters.queryStringBehavior + = QueryStringBehavior.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedCacheKeyQueryStringActionParameters.typeName + = DeliveryRuleActionParametersType.fromString(reader.getString()); + } else if ("queryParameters".equals(fieldName)) { + deserializedCacheKeyQueryStringActionParameters.queryParameters = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCacheKeyQueryStringActionParameters; + }); + } +} 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 000000000000..bcd7a25d89eb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheType.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 java.util.Collection; + +/** + * The level at which the content needs to be cached. + */ +public final class CacheType extends ExpandableStringEnum { + /** + * Static value All for CacheType. + */ + public static final CacheType ALL = fromString("All"); + + /** + * Creates a new instance of CacheType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CacheType() { + } + + /** + * Creates or finds a CacheType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CacheType. + */ + public static CacheType fromString(String name) { + return fromString(name, CacheType.class); + } + + /** + * Gets known CacheType values. + * + * @return known CacheType values. + */ + public static Collection values() { + return values(CacheType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateDefaultSku.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateDefaultSku.java new file mode 100644 index 000000000000..a5625b37e4d5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateDefaultSku.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Recommended sku for the migration. + */ +public final class CanMigrateDefaultSku extends ExpandableStringEnum { + /** + * Static value Standard_AzureFrontDoor for CanMigrateDefaultSku. + */ + public static final CanMigrateDefaultSku STANDARD_AZURE_FRONT_DOOR = fromString("Standard_AzureFrontDoor"); + + /** + * Static value Premium_AzureFrontDoor for CanMigrateDefaultSku. + */ + public static final CanMigrateDefaultSku PREMIUM_AZURE_FRONT_DOOR = fromString("Premium_AzureFrontDoor"); + + /** + * Creates a new instance of CanMigrateDefaultSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CanMigrateDefaultSku() { + } + + /** + * Creates or finds a CanMigrateDefaultSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding CanMigrateDefaultSku. + */ + public static CanMigrateDefaultSku fromString(String name) { + return fromString(name, CanMigrateDefaultSku.class); + } + + /** + * Gets known CanMigrateDefaultSku values. + * + * @return known CanMigrateDefaultSku values. + */ + public static Collection values() { + return values(CanMigrateDefaultSku.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateParameters.java new file mode 100644 index 000000000000..1efa7f4c669e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateParameters.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body for CanMigrate operation. + */ +@Fluent +public final class CanMigrateParameters implements JsonSerializable { + /* + * Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + */ + private ResourceReference classicResourceReference; + + /** + * Creates an instance of CanMigrateParameters class. + */ + public CanMigrateParameters() { + } + + /** + * Get the classicResourceReference property: Resource reference of the classic cdn profile or classic frontdoor + * that need to be migrated. + * + * @return the classicResourceReference value. + */ + public ResourceReference classicResourceReference() { + return this.classicResourceReference; + } + + /** + * Set the classicResourceReference property: Resource reference of the classic cdn profile or classic frontdoor + * that need to be migrated. + * + * @param classicResourceReference the classicResourceReference value to set. + * @return the CanMigrateParameters object itself. + */ + public CanMigrateParameters withClassicResourceReference(ResourceReference classicResourceReference) { + this.classicResourceReference = classicResourceReference; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (classicResourceReference() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property classicResourceReference in model CanMigrateParameters")); + } else { + classicResourceReference().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CanMigrateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("classicResourceReference", this.classicResourceReference); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CanMigrateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CanMigrateParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CanMigrateParameters. + */ + public static CanMigrateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CanMigrateParameters deserializedCanMigrateParameters = new CanMigrateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("classicResourceReference".equals(fieldName)) { + deserializedCanMigrateParameters.classicResourceReference = ResourceReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCanMigrateParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateResult.java new file mode 100644 index 000000000000..da01a1622959 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateResult.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.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner; +import java.util.List; + +/** + * An immutable client-side representation of CanMigrateResult. + */ +public interface CanMigrateResult { + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the canMigrate property: Flag that says if the profile can be migrated. + * + * @return the canMigrate value. + */ + Boolean canMigrate(); + + /** + * Gets the defaultSku property: Recommended sku for the migration. + * + * @return the defaultSku value. + */ + CanMigrateDefaultSku defaultSku(); + + /** + * Gets the errors property: The errors property. + * + * @return the errors value. + */ + List errors(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner object. + * + * @return the inner object. + */ + CanMigrateResultInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnCertificateSourceParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnCertificateSourceParameters.java new file mode 100644 index 000000000000..1783fe479cf8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnCertificateSourceParameters.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for using CDN managed certificate for securing custom domain. + */ +@Fluent +public final class CdnCertificateSourceParameters extends CertificateSourceParameters { + /* + * The typeName property. + */ + private CertificateSourceParametersType typeName + = CertificateSourceParametersType.CDN_CERTIFICATE_SOURCE_PARAMETERS; + + /* + * Type of certificate used + */ + private CertificateType certificateType; + + /** + * Creates an instance of CdnCertificateSourceParameters class. + */ + public CdnCertificateSourceParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public CertificateSourceParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (certificateType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property certificateType in model CdnCertificateSourceParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CdnCertificateSourceParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("certificateType", + this.certificateType == null ? null : this.certificateType.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CdnCertificateSourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CdnCertificateSourceParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CdnCertificateSourceParameters. + */ + public static CdnCertificateSourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CdnCertificateSourceParameters deserializedCdnCertificateSourceParameters + = new CdnCertificateSourceParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificateType".equals(fieldName)) { + deserializedCdnCertificateSourceParameters.certificateType + = CertificateType.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedCdnCertificateSourceParameters.typeName + = CertificateSourceParametersType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCdnCertificateSourceParameters; + }); + } +} 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 000000000000..bab07f1de02a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnEndpoint.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the ARM Resource ID for the linked endpoints. + */ +@Fluent +public final class CdnEndpoint implements JsonSerializable { + /* + * ARM Resource ID string. + */ + private String id; + + /** + * Creates an instance of CdnEndpoint class. + */ + public CdnEndpoint() { + } + + /** + * Get the id property: ARM Resource ID string. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ARM Resource ID string. + * + * @param id the id value to set. + * @return the CdnEndpoint object itself. + */ + public CdnEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CdnEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CdnEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CdnEndpoint. + */ + public static CdnEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CdnEndpoint deserializedCdnEndpoint = new CdnEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCdnEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCdnEndpoint; + }); + } +} 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 000000000000..d3a5d7c22df4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnManagedHttpsParameters.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the certificate source parameters using CDN managed certificate for enabling SSL. + */ +@Fluent +public final class CdnManagedHttpsParameters extends CustomDomainHttpsParameters { + /* + * Defines the source of the SSL certificate. + */ + private CertificateSource certificateSource = CertificateSource.CDN; + + /* + * Defines the certificate source parameters using CDN managed certificate for enabling SSL. + */ + private CdnCertificateSourceParameters certificateSourceParameters; + + /** + * Creates an instance of CdnManagedHttpsParameters class. + */ + public CdnManagedHttpsParameters() { + } + + /** + * Get the certificateSource property: Defines the source of the SSL certificate. + * + * @return the certificateSource value. + */ + @Override + public CertificateSource certificateSource() { + return this.certificateSource; + } + + /** + * 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() { + if (certificateSourceParameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property certificateSourceParameters in model CdnManagedHttpsParameters")); + } else { + certificateSourceParameters().validate(); + } + if (protocolType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property protocolType in model CdnManagedHttpsParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CdnManagedHttpsParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocolType", protocolType() == null ? null : protocolType().toString()); + jsonWriter.writeStringField("minimumTlsVersion", + minimumTlsVersion() == null ? null : minimumTlsVersion().toString()); + jsonWriter.writeJsonField("certificateSourceParameters", this.certificateSourceParameters); + jsonWriter.writeStringField("certificateSource", + this.certificateSource == null ? null : this.certificateSource.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CdnManagedHttpsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CdnManagedHttpsParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CdnManagedHttpsParameters. + */ + public static CdnManagedHttpsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CdnManagedHttpsParameters deserializedCdnManagedHttpsParameters = new CdnManagedHttpsParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocolType".equals(fieldName)) { + deserializedCdnManagedHttpsParameters.withProtocolType(ProtocolType.fromString(reader.getString())); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedCdnManagedHttpsParameters + .withMinimumTlsVersion(MinimumTlsVersion.fromString(reader.getString())); + } else if ("certificateSourceParameters".equals(fieldName)) { + deserializedCdnManagedHttpsParameters.certificateSourceParameters + = CdnCertificateSourceParameters.fromJson(reader); + } else if ("certificateSource".equals(fieldName)) { + deserializedCdnManagedHttpsParameters.certificateSource + = CertificateSource.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCdnManagedHttpsParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnMigrationToAfdParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnMigrationToAfdParameters.java new file mode 100644 index 000000000000..80bc357fcce9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnMigrationToAfdParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Request body for Migrate operation. + */ +@Fluent +public final class CdnMigrationToAfdParameters implements JsonSerializable { + /* + * Sku for the migration + */ + private Sku sku; + + /* + * A name map between classic CDN endpoints and AFD Premium/Standard endpoints. + */ + private List migrationEndpointMappings; + + /** + * Creates an instance of CdnMigrationToAfdParameters class. + */ + public CdnMigrationToAfdParameters() { + } + + /** + * Get the sku property: Sku for the migration. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku for the migration. + * + * @param sku the sku value to set. + * @return the CdnMigrationToAfdParameters object itself. + */ + public CdnMigrationToAfdParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the migrationEndpointMappings property: A name map between classic CDN endpoints and AFD Premium/Standard + * endpoints. + * + * @return the migrationEndpointMappings value. + */ + public List migrationEndpointMappings() { + return this.migrationEndpointMappings; + } + + /** + * Set the migrationEndpointMappings property: A name map between classic CDN endpoints and AFD Premium/Standard + * endpoints. + * + * @param migrationEndpointMappings the migrationEndpointMappings value to set. + * @return the CdnMigrationToAfdParameters object itself. + */ + public CdnMigrationToAfdParameters + withMigrationEndpointMappings(List migrationEndpointMappings) { + this.migrationEndpointMappings = migrationEndpointMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property sku in model CdnMigrationToAfdParameters")); + } else { + sku().validate(); + } + if (migrationEndpointMappings() != null) { + migrationEndpointMappings().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CdnMigrationToAfdParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeArrayField("migrationEndpointMappings", this.migrationEndpointMappings, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CdnMigrationToAfdParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CdnMigrationToAfdParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CdnMigrationToAfdParameters. + */ + public static CdnMigrationToAfdParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CdnMigrationToAfdParameters deserializedCdnMigrationToAfdParameters = new CdnMigrationToAfdParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedCdnMigrationToAfdParameters.sku = Sku.fromJson(reader); + } else if ("migrationEndpointMappings".equals(fieldName)) { + List migrationEndpointMappings + = reader.readArray(reader1 -> MigrationEndpointMapping.fromJson(reader1)); + deserializedCdnMigrationToAfdParameters.migrationEndpointMappings = migrationEndpointMappings; + } else { + reader.skipChildren(); + } + } + + return deserializedCdnMigrationToAfdParameters; + }); + } +} 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 000000000000..a1fe8580ec61 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicy.java @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of CdnWebApplicationFirewallPolicy. + */ +public interface CdnWebApplicationFirewallPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: Gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the policySettings property: Describes policySettings for policy. + * + * @return the policySettings value. + */ + PolicySettings policySettings(); + + /** + * Gets the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @return the rateLimitRules value. + */ + RateLimitRuleList rateLimitRules(); + + /** + * Gets the customRules property: Describes custom rules inside the policy. + * + * @return the customRules value. + */ + CustomRuleList customRules(); + + /** + * Gets the managedRules property: Describes managed rules inside the policy. + * + * @return the managedRules value. + */ + ManagedRuleSetList managedRules(); + + /** + * Gets the endpointLinks property: Describes Azure CDN endpoints associated with this Web Application Firewall + * policy. + * + * @return the endpointLinks value. + */ + List endpointLinks(); + + /** + * Gets the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @return the extendedProperties value. + */ + Map extendedProperties(); + + /** + * Gets the provisioningState property: Provisioning state of the WebApplicationFirewallPolicy. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + PolicyResourceState resourceState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner object. + * + * @return the inner object. + */ + CdnWebApplicationFirewallPolicyInner innerModel(); + + /** + * The entirety of the CdnWebApplicationFirewallPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * The CdnWebApplicationFirewallPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CdnWebApplicationFirewallPolicy definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy.. + * + * @param sku The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithEtag, + DefinitionStages.WithPolicySettings, DefinitionStages.WithRateLimitRules, DefinitionStages.WithCustomRules, + DefinitionStages.WithManagedRules, DefinitionStages.WithExtendedProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CdnWebApplicationFirewallPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CdnWebApplicationFirewallPolicy create(Context context); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify etag. + */ + interface WithEtag { + /** + * Specifies the etag property: Gets a unique read-only string that changes whenever the resource is + * updated.. + * + * @param etag Gets a unique read-only string that changes whenever the resource is updated. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify policySettings. + */ + interface WithPolicySettings { + /** + * Specifies the policySettings property: Describes policySettings for policy. + * + * @param policySettings Describes policySettings for policy. + * @return the next definition stage. + */ + WithCreate withPolicySettings(PolicySettings policySettings); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify rateLimitRules. + */ + interface WithRateLimitRules { + /** + * Specifies the rateLimitRules property: Describes rate limit rules inside the policy.. + * + * @param rateLimitRules Describes rate limit rules inside the policy. + * @return the next definition stage. + */ + WithCreate withRateLimitRules(RateLimitRuleList rateLimitRules); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify customRules. + */ + interface WithCustomRules { + /** + * Specifies the customRules property: Describes custom rules inside the policy.. + * + * @param customRules Describes custom rules inside the policy. + * @return the next definition stage. + */ + WithCreate withCustomRules(CustomRuleList customRules); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify managedRules. + */ + interface WithManagedRules { + /** + * Specifies the managedRules property: Describes managed rules inside the policy.. + * + * @param managedRules Describes managed rules inside the policy. + * @return the next definition stage. + */ + WithCreate withManagedRules(ManagedRuleSetList managedRules); + } + + /** + * The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify extendedProperties. + */ + interface WithExtendedProperties { + /** + * Specifies the extendedProperties property: Key-Value pair representing additional properties for Web + * Application Firewall policy.. + * + * @param extendedProperties Key-Value pair representing additional properties for Web Application Firewall + * policy. + * @return the next definition stage. + */ + WithCreate withExtendedProperties(Map extendedProperties); + } + } + + /** + * Begins update for the CdnWebApplicationFirewallPolicy resource. + * + * @return the stage of resource update. + */ + CdnWebApplicationFirewallPolicy.Update update(); + + /** + * The template for CdnWebApplicationFirewallPolicy update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CdnWebApplicationFirewallPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CdnWebApplicationFirewallPolicy apply(Context context); + } + + /** + * The CdnWebApplicationFirewallPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the CdnWebApplicationFirewallPolicy update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: CdnWebApplicationFirewallPolicy tags. + * + * @param tags CdnWebApplicationFirewallPolicy tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CdnWebApplicationFirewallPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CdnWebApplicationFirewallPolicy refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyList.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyList.java new file mode 100644 index 000000000000..d4fb17ce24c7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyList.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.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * List of Azure CDN WebApplicationFirewallPolicies within a resource group. + */ + private List value; + + /* + * URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of CdnWebApplicationFirewallPolicyList class. + */ + public CdnWebApplicationFirewallPolicyList() { + } + + /** + * Get the value property: List of Azure CDN WebApplicationFirewallPolicies within a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the CdnWebApplicationFirewallPolicyList object itself. + */ + public CdnWebApplicationFirewallPolicyList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CdnWebApplicationFirewallPolicyList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CdnWebApplicationFirewallPolicyList if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CdnWebApplicationFirewallPolicyList. + */ + public static CdnWebApplicationFirewallPolicyList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CdnWebApplicationFirewallPolicyList deserializedCdnWebApplicationFirewallPolicyList + = new CdnWebApplicationFirewallPolicyList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CdnWebApplicationFirewallPolicyInner.fromJson(reader1)); + deserializedCdnWebApplicationFirewallPolicyList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCdnWebApplicationFirewallPolicyList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCdnWebApplicationFirewallPolicyList; + }); + } +} 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 000000000000..59679dede9a3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyPatchParameters.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Properties required to update a CdnWebApplicationFirewallPolicy. + */ +@Fluent +public final class CdnWebApplicationFirewallPolicyPatchParameters + implements JsonSerializable { + /* + * CdnWebApplicationFirewallPolicy tags + */ + private Map tags; + + /** + * Creates an instance of CdnWebApplicationFirewallPolicyPatchParameters class. + */ + public CdnWebApplicationFirewallPolicyPatchParameters() { + } + + /** + * Get the tags property: CdnWebApplicationFirewallPolicy tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: CdnWebApplicationFirewallPolicy tags. + * + * @param tags the tags value to set. + * @return the CdnWebApplicationFirewallPolicyPatchParameters object itself. + */ + public CdnWebApplicationFirewallPolicyPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CdnWebApplicationFirewallPolicyPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CdnWebApplicationFirewallPolicyPatchParameters if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CdnWebApplicationFirewallPolicyPatchParameters. + */ + public static CdnWebApplicationFirewallPolicyPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CdnWebApplicationFirewallPolicyPatchParameters deserializedCdnWebApplicationFirewallPolicyPatchParameters + = new CdnWebApplicationFirewallPolicyPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCdnWebApplicationFirewallPolicyPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCdnWebApplicationFirewallPolicyPatchParameters; + }); + } +} 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 000000000000..36d393c4a9e0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Certificate.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Certificate used for https. + */ +@Fluent +public class Certificate implements JsonSerializable { + /* + * The type of the secret resource. + */ + private SecretType type; + + /* + * Subject name in the certificate. + */ + private String subject; + + /* + * Certificate expiration date. + */ + private String expirationDate; + + /** + * Creates an instance of Certificate class. + */ + public Certificate() { + } + + /** + * Get the type property: The type of the secret resource. + * + * @return the type value. + */ + public SecretType type() { + return this.type; + } + + /** + * Set the type property: The type of the secret resource. + * + * @param type the type value to set. + * @return the Certificate object itself. + */ + public Certificate withType(SecretType type) { + this.type = type; + return this; + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: Subject name in the certificate. + * + * @param subject the subject value to set. + * @return the Certificate object itself. + */ + 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. + */ + Certificate withExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Certificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Certificate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Certificate. + */ + public static Certificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Certificate deserializedCertificate = new Certificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedCertificate.type = SecretType.fromString(reader.getString()); + } else if ("subject".equals(fieldName)) { + deserializedCertificate.subject = reader.getString(); + } else if ("expirationDate".equals(fieldName)) { + deserializedCertificate.expirationDate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificate; + }); + } +} 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 000000000000..e366956f6796 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSource.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the source of the SSL certificate. + */ +public final class CertificateSource extends ExpandableStringEnum { + /** + * Static value AzureKeyVault for CertificateSource. + */ + public static final CertificateSource AZURE_KEY_VAULT = fromString("AzureKeyVault"); + + /** + * Static value Cdn for CertificateSource. + */ + public static final CertificateSource CDN = fromString("Cdn"); + + /** + * Creates a new instance of CertificateSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CertificateSource() { + } + + /** + * Creates or finds a CertificateSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateSource. + */ + public static CertificateSource fromString(String name) { + return fromString(name, CertificateSource.class); + } + + /** + * Gets known CertificateSource values. + * + * @return known CertificateSource values. + */ + public static Collection values() { + return values(CertificateSource.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSourceParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSourceParameters.java new file mode 100644 index 000000000000..23b214e57116 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSourceParameters.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for certificate source. + */ +@Immutable +public class CertificateSourceParameters implements JsonSerializable { + /* + * The typeName property. + */ + private CertificateSourceParametersType typeName + = CertificateSourceParametersType.fromString("CertificateSourceParameters"); + + /** + * Creates an instance of CertificateSourceParameters class. + */ + public CertificateSourceParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public CertificateSourceParametersType typeName() { + return this.typeName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateSourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateSourceParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateSourceParameters. + */ + public static CertificateSourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("typeName".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("CdnCertificateSourceParameters".equals(discriminatorValue)) { + return CdnCertificateSourceParameters.fromJson(readerToUse.reset()); + } else if ("KeyVaultCertificateSourceParameters".equals(discriminatorValue)) { + return KeyVaultCertificateSourceParameters.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static CertificateSourceParameters fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateSourceParameters deserializedCertificateSourceParameters = new CertificateSourceParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("typeName".equals(fieldName)) { + deserializedCertificateSourceParameters.typeName + = CertificateSourceParametersType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateSourceParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSourceParametersType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSourceParametersType.java new file mode 100644 index 000000000000..6b53a8c8c45c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSourceParametersType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for CertificateSourceParametersType. + */ +public final class CertificateSourceParametersType extends ExpandableStringEnum { + /** + * Static value CdnCertificateSourceParameters for CertificateSourceParametersType. + */ + public static final CertificateSourceParametersType CDN_CERTIFICATE_SOURCE_PARAMETERS + = fromString("CdnCertificateSourceParameters"); + + /** + * Static value KeyVaultCertificateSourceParameters for CertificateSourceParametersType. + */ + public static final CertificateSourceParametersType KEY_VAULT_CERTIFICATE_SOURCE_PARAMETERS + = fromString("KeyVaultCertificateSourceParameters"); + + /** + * Creates a new instance of CertificateSourceParametersType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CertificateSourceParametersType() { + } + + /** + * Creates or finds a CertificateSourceParametersType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateSourceParametersType. + */ + public static CertificateSourceParametersType fromString(String name) { + return fromString(name, CertificateSourceParametersType.class); + } + + /** + * Gets known CertificateSourceParametersType values. + * + * @return known CertificateSourceParametersType values. + */ + public static Collection values() { + return values(CertificateSourceParametersType.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 000000000000..b2673a317158 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of certificate used. + */ +public final class CertificateType extends ExpandableStringEnum { + /** + * Static value Shared for CertificateType. + */ + public static final CertificateType SHARED = fromString("Shared"); + + /** + * Static value Dedicated for CertificateType. + */ + public static final CertificateType DEDICATED = fromString("Dedicated"); + + /** + * Creates a new instance of CertificateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CertificateType() { + } + + /** + * Creates or finds a CertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateType. + */ + public static CertificateType fromString(String name) { + return fromString(name, CertificateType.class); + } + + /** + * Gets known CertificateType values. + * + * @return known CertificateType values. + */ + public static Collection values() { + return values(CertificateType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityInput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityInput.java new file mode 100644 index 000000000000..75d7ff8bd8bb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityInput.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input of CheckNameAvailability API. + */ +@Fluent +public final class CheckEndpointNameAvailabilityInput implements JsonSerializable { + /* + * The resource name to validate. + */ + private String name; + + /* + * The type of the resource whose name is to be validated. + */ + private ResourceType type; + + /* + * Indicates the endpoint name reuse scope. The default value is TenantReuse. + */ + private AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope; + + /** + * Creates an instance of CheckEndpointNameAvailabilityInput class. + */ + public CheckEndpointNameAvailabilityInput() { + } + + /** + * Get the name property: The resource name to validate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The resource name to validate. + * + * @param name the name value to set. + * @return the CheckEndpointNameAvailabilityInput object itself. + */ + public CheckEndpointNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the resource whose name is to be validated. + * + * @return the type value. + */ + public ResourceType type() { + return this.type; + } + + /** + * Set the type property: The type of the resource whose name is to be validated. + * + * @param type the type value to set. + * @return the CheckEndpointNameAvailabilityInput object itself. + */ + public CheckEndpointNameAvailabilityInput withType(ResourceType type) { + this.type = type; + return this; + } + + /** + * Get the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() { + return this.autoGeneratedDomainNameLabelScope; + } + + /** + * Set the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set. + * @return the CheckEndpointNameAvailabilityInput object itself. + */ + public CheckEndpointNameAvailabilityInput + withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) { + this.autoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model CheckEndpointNameAvailabilityInput")); + } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model CheckEndpointNameAvailabilityInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckEndpointNameAvailabilityInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("autoGeneratedDomainNameLabelScope", + this.autoGeneratedDomainNameLabelScope == null ? null : this.autoGeneratedDomainNameLabelScope.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckEndpointNameAvailabilityInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckEndpointNameAvailabilityInput if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CheckEndpointNameAvailabilityInput. + */ + public static CheckEndpointNameAvailabilityInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckEndpointNameAvailabilityInput deserializedCheckEndpointNameAvailabilityInput + = new CheckEndpointNameAvailabilityInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCheckEndpointNameAvailabilityInput.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCheckEndpointNameAvailabilityInput.type = ResourceType.fromString(reader.getString()); + } else if ("autoGeneratedDomainNameLabelScope".equals(fieldName)) { + deserializedCheckEndpointNameAvailabilityInput.autoGeneratedDomainNameLabelScope + = AutoGeneratedDomainNameLabelScope.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckEndpointNameAvailabilityInput; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityOutput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityOutput.java new file mode 100644 index 000000000000..96210f2b2834 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityOutput.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; + +/** + * An immutable client-side representation of CheckEndpointNameAvailabilityOutput. + */ +public interface CheckEndpointNameAvailabilityOutput { + /** + * Gets the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the availableHostname property: Returns the available hostname generated based on the + * AutoGeneratedDomainNameLabelScope when the name is available, otherwise it returns empty string. + * + * @return the availableHostname value. + */ + String availableHostname(); + + /** + * Gets the reason property: The reason why the name is not available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: The detailed error message describing why the name is not available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner + * object. + * + * @return the inner object. + */ + CheckEndpointNameAvailabilityOutputInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckHostnameAvailabilityInput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckHostnameAvailabilityInput.java new file mode 100644 index 000000000000..5fb9e28829be --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckHostnameAvailabilityInput.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input of CheckHostNameAvailability API. + */ +@Fluent +public final class CheckHostnameAvailabilityInput implements JsonSerializable { + /* + * The host name to validate. + */ + private String hostname; + + /** + * Creates an instance of CheckHostnameAvailabilityInput class. + */ + public CheckHostnameAvailabilityInput() { + } + + /** + * Get the hostname property: The host name to validate. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name to validate. + * + * @param hostname the hostname value to set. + * @return the CheckHostnameAvailabilityInput object itself. + */ + public CheckHostnameAvailabilityInput withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hostname in model CheckHostnameAvailabilityInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckHostnameAvailabilityInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckHostnameAvailabilityInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckHostnameAvailabilityInput if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CheckHostnameAvailabilityInput. + */ + public static CheckHostnameAvailabilityInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckHostnameAvailabilityInput deserializedCheckHostnameAvailabilityInput + = new CheckHostnameAvailabilityInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedCheckHostnameAvailabilityInput.hostname = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckHostnameAvailabilityInput; + }); + } +} 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 000000000000..3ef6716f40e3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityInput.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input of CheckNameAvailability API. + */ +@Fluent +public final class CheckNameAvailabilityInput implements JsonSerializable { + /* + * The resource name to validate. + */ + private String name; + + /* + * The type of the resource whose name is to be validated. + */ + private ResourceType type; + + /** + * Creates an instance of CheckNameAvailabilityInput class. + */ + public CheckNameAvailabilityInput() { + } + + /** + * Get the name property: The resource name to validate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The resource name to validate. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the resource whose name is to be validated. + * + * @return the type value. + */ + public ResourceType type() { + return this.type; + } + + /** + * Set the type property: The type of the resource whose name is to be validated. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withType(ResourceType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property name in model CheckNameAvailabilityInput")); + } + if (type() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property type in model CheckNameAvailabilityInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityInput if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityInput. + */ + public static CheckNameAvailabilityInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityInput deserializedCheckNameAvailabilityInput = new CheckNameAvailabilityInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCheckNameAvailabilityInput.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCheckNameAvailabilityInput.type = ResourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityInput; + }); + } +} 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 000000000000..e777bb37801c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityOutput.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.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 000000000000..dca4d7c25911 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CidrIpAddress.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * CIDR Ip address. + */ +@Fluent +public final class CidrIpAddress implements JsonSerializable { + /* + * Ip address itself. + */ + private String baseIpAddress; + + /* + * The length of the prefix of the ip address. + */ + private Integer prefixLength; + + /** + * Creates an instance of CidrIpAddress class. + */ + public CidrIpAddress() { + } + + /** + * Get the baseIpAddress property: Ip address itself. + * + * @return the baseIpAddress value. + */ + public String baseIpAddress() { + return this.baseIpAddress; + } + + /** + * Set the baseIpAddress property: Ip address itself. + * + * @param baseIpAddress the baseIpAddress value to set. + * @return the CidrIpAddress object itself. + */ + public CidrIpAddress withBaseIpAddress(String baseIpAddress) { + this.baseIpAddress = baseIpAddress; + return this; + } + + /** + * Get the prefixLength property: The length of the prefix of the ip address. + * + * @return the prefixLength value. + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Set the prefixLength property: The length of the prefix of the ip address. + * + * @param prefixLength the prefixLength value to set. + * @return the CidrIpAddress object itself. + */ + public CidrIpAddress withPrefixLength(Integer prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("baseIpAddress", this.baseIpAddress); + jsonWriter.writeNumberField("prefixLength", this.prefixLength); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CidrIpAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CidrIpAddress if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CidrIpAddress. + */ + public static CidrIpAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CidrIpAddress deserializedCidrIpAddress = new CidrIpAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseIpAddress".equals(fieldName)) { + deserializedCidrIpAddress.baseIpAddress = reader.getString(); + } else if ("prefixLength".equals(fieldName)) { + deserializedCidrIpAddress.prefixLength = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCidrIpAddress; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortMatchConditionParameters.java new file mode 100644 index 000000000000..0b5111554371 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for ClientPort match conditions. + */ +@Fluent +public final class ClientPortMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_CLIENT_PORT_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private ClientPortOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of ClientPortMatchConditionParameters class. + */ + public ClientPortMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public ClientPortOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the ClientPortMatchConditionParameters object itself. + */ + public ClientPortMatchConditionParameters withOperator(ClientPortOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the ClientPortMatchConditionParameters object itself. + */ + public ClientPortMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the ClientPortMatchConditionParameters object itself. + */ + public ClientPortMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the ClientPortMatchConditionParameters object itself. + */ + public ClientPortMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model ClientPortMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClientPortMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientPortMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientPortMatchConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClientPortMatchConditionParameters. + */ + public static ClientPortMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientPortMatchConditionParameters deserializedClientPortMatchConditionParameters + = new ClientPortMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedClientPortMatchConditionParameters.operator + = ClientPortOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedClientPortMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedClientPortMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedClientPortMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedClientPortMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedClientPortMatchConditionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortOperator.java new file mode 100644 index 000000000000..99095c60fd76 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class ClientPortOperator extends ExpandableStringEnum { + /** + * Static value Any for ClientPortOperator. + */ + public static final ClientPortOperator ANY = fromString("Any"); + + /** + * Static value Equal for ClientPortOperator. + */ + public static final ClientPortOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for ClientPortOperator. + */ + public static final ClientPortOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for ClientPortOperator. + */ + public static final ClientPortOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for ClientPortOperator. + */ + public static final ClientPortOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for ClientPortOperator. + */ + public static final ClientPortOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for ClientPortOperator. + */ + public static final ClientPortOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for ClientPortOperator. + */ + public static final ClientPortOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for ClientPortOperator. + */ + public static final ClientPortOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for ClientPortOperator. + */ + public static final ClientPortOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of ClientPortOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClientPortOperator() { + } + + /** + * Creates or finds a ClientPortOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClientPortOperator. + */ + public static ClientPortOperator fromString(String name) { + return fromString(name, ClientPortOperator.class); + } + + /** + * Gets known ClientPortOperator values. + * + * @return known ClientPortOperator values. + */ + public static Collection values() { + return values(ClientPortOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CompressionSettings.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CompressionSettings.java new file mode 100644 index 000000000000..a7e274263797 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CompressionSettings.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * settings for compression. + */ +@Fluent +public final class CompressionSettings implements JsonSerializable { + /* + * List of content types on which compression applies. The value should be a valid MIME type. + */ + private List contentTypesToCompress; + + /* + * Indicates whether content compression is enabled on AzureFrontDoor. Default value is false. If compression is + * enabled, content will be served as compressed if user requests for a compressed version. Content won't be + * compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. + */ + private Boolean isCompressionEnabled; + + /** + * Creates an instance of CompressionSettings class. + */ + public CompressionSettings() { + } + + /** + * Get the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + public List contentTypesToCompress() { + return this.contentTypesToCompress; + } + + /** + * Set the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set. + * @return the CompressionSettings object itself. + */ + public CompressionSettings withContentTypesToCompress(List contentTypesToCompress) { + this.contentTypesToCompress = contentTypesToCompress; + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled on AzureFrontDoor. + * Default value is false. If compression is enabled, content will be served as compressed if user requests for a + * compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte + * or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public Boolean isCompressionEnabled() { + return this.isCompressionEnabled; + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled on AzureFrontDoor. + * Default value is false. If compression is enabled, content will be served as compressed if user requests for a + * compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte + * or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the CompressionSettings object itself. + */ + public CompressionSettings withIsCompressionEnabled(Boolean isCompressionEnabled) { + this.isCompressionEnabled = isCompressionEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("contentTypesToCompress", this.contentTypesToCompress, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isCompressionEnabled", this.isCompressionEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompressionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompressionSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CompressionSettings. + */ + public static CompressionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CompressionSettings deserializedCompressionSettings = new CompressionSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentTypesToCompress".equals(fieldName)) { + List contentTypesToCompress = reader.readArray(reader1 -> reader1.getString()); + deserializedCompressionSettings.contentTypesToCompress = contentTypesToCompress; + } else if ("isCompressionEnabled".equals(fieldName)) { + deserializedCompressionSettings.isCompressionEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCompressionSettings; + }); + } +} 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 000000000000..b2a5cb4b4d98 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponse.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.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 000000000000..a4e56a4a885b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseContinentsItem.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ContinentsResponseContinentsItem model. + */ +@Fluent +public final class ContinentsResponseContinentsItem implements JsonSerializable { + /* + * The id property. + */ + private String id; + + /** + * Creates an instance of ContinentsResponseContinentsItem class. + */ + public ContinentsResponseContinentsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ContinentsResponseContinentsItem object itself. + */ + public ContinentsResponseContinentsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContinentsResponseContinentsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContinentsResponseContinentsItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContinentsResponseContinentsItem. + */ + public static ContinentsResponseContinentsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContinentsResponseContinentsItem deserializedContinentsResponseContinentsItem + = new ContinentsResponseContinentsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContinentsResponseContinentsItem.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContinentsResponseContinentsItem; + }); + } +} 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 000000000000..8a63675ba7bf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseCountryOrRegionsItem.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ContinentsResponseCountryOrRegionsItem model. + */ +@Fluent +public final class ContinentsResponseCountryOrRegionsItem + implements JsonSerializable { + /* + * The id property. + */ + private String id; + + /* + * The continentId property. + */ + private String continentId; + + /** + * Creates an instance of ContinentsResponseCountryOrRegionsItem class. + */ + public ContinentsResponseCountryOrRegionsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ContinentsResponseCountryOrRegionsItem object itself. + */ + public ContinentsResponseCountryOrRegionsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the continentId property: The continentId property. + * + * @return the continentId value. + */ + public String continentId() { + return this.continentId; + } + + /** + * Set the continentId property: The continentId property. + * + * @param continentId the continentId value to set. + * @return the ContinentsResponseCountryOrRegionsItem object itself. + */ + public ContinentsResponseCountryOrRegionsItem withContinentId(String continentId) { + this.continentId = continentId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("continentId", this.continentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContinentsResponseCountryOrRegionsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContinentsResponseCountryOrRegionsItem if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContinentsResponseCountryOrRegionsItem. + */ + public static ContinentsResponseCountryOrRegionsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContinentsResponseCountryOrRegionsItem deserializedContinentsResponseCountryOrRegionsItem + = new ContinentsResponseCountryOrRegionsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContinentsResponseCountryOrRegionsItem.id = reader.getString(); + } else if ("continentId".equals(fieldName)) { + deserializedContinentsResponseCountryOrRegionsItem.continentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContinentsResponseCountryOrRegionsItem; + }); + } +} 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 000000000000..1b6bed214620 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesMatchConditionParameters.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for Cookies match conditions. + */ +@Fluent +public final class CookiesMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_COOKIES_CONDITION_PARAMETERS; + + /* + * Name of Cookies to be matched + */ + private String selector; + + /* + * Describes operator to be matched + */ + private CookiesOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of CookiesMatchConditionParameters class. + */ + public CookiesMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model CookiesMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CookiesMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("selector", this.selector); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CookiesMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CookiesMatchConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CookiesMatchConditionParameters. + */ + public static CookiesMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CookiesMatchConditionParameters deserializedCookiesMatchConditionParameters + = new CookiesMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedCookiesMatchConditionParameters.operator + = CookiesOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedCookiesMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("selector".equals(fieldName)) { + deserializedCookiesMatchConditionParameters.selector = reader.getString(); + } else if ("negateCondition".equals(fieldName)) { + deserializedCookiesMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedCookiesMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedCookiesMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedCookiesMatchConditionParameters; + }); + } +} 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 000000000000..867c5d246688 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class CookiesOperator extends ExpandableStringEnum { + /** + * Static value Any for CookiesOperator. + */ + public static final CookiesOperator ANY = fromString("Any"); + + /** + * Static value Equal for CookiesOperator. + */ + public static final CookiesOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for CookiesOperator. + */ + public static final CookiesOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for CookiesOperator. + */ + public static final CookiesOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for CookiesOperator. + */ + public static final CookiesOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for CookiesOperator. + */ + public static final CookiesOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for CookiesOperator. + */ + public static final CookiesOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for CookiesOperator. + */ + public static final CookiesOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for CookiesOperator. + */ + public static final CookiesOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for CookiesOperator. + */ + public static final CookiesOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of CookiesOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CookiesOperator() { + } + + /** + * Creates or finds a CookiesOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding CookiesOperator. + */ + public static CookiesOperator fromString(String name) { + return fromString(name, CookiesOperator.class); + } + + /** + * Gets known CookiesOperator values. + * + * @return known CookiesOperator values. + */ + public static Collection values() { + return values(CookiesOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomain.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomain.java new file mode 100644 index 000000000000..dd3a0ae7efa3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomain.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.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; + +/** + * An immutable client-side representation of CustomDomain. + */ +public interface CustomDomain { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the resourceState property: Resource status of the custom domain. + * + * @return the resourceState value. + */ + CustomDomainResourceState resourceState(); + + /** + * Gets the customHttpsProvisioningState property: Provisioning status of the custom domain. + * + * @return the customHttpsProvisioningState value. + */ + CustomHttpsProvisioningState customHttpsProvisioningState(); + + /** + * Gets the customHttpsProvisioningSubstate property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. + * + * @return the customHttpsProvisioningSubstate value. + */ + CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate(); + + /** + * Gets the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @return the customHttpsParameters value. + */ + CustomDomainHttpsParameters customHttpsParameters(); + + /** + * Gets the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + String validationData(); + + /** + * Gets the provisioningState property: Provisioning status of Custom Https of the custom domain. + * + * @return the provisioningState value. + */ + CustomHttpsProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner object. + * + * @return the inner object. + */ + CustomDomainInner innerModel(); + + /** + * The entirety of the CustomDomain definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The CustomDomain definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CustomDomain definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the CustomDomain definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, endpointName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @return the next definition stage. + */ + WithCreate withExistingEndpoint(String resourceGroupName, String profileName, String endpointName); + } + + /** + * The stage of the CustomDomain definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithHostname { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomDomain create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomDomain create(Context context); + } + + /** + * The stage of the CustomDomain definition allowing to specify hostname. + */ + interface WithHostname { + /** + * Specifies the hostname property: The host name of the custom domain. Must be a domain name.. + * + * @param hostname The host name of the custom domain. Must be a domain name. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomDomain refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomDomain refresh(Context context); + + /** + * Disable https delivery of the custom domain. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain disableCustomHttps(); + + /** + * Disable https delivery of the custom domain. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain disableCustomHttps(Context context); + + /** + * Enable https delivery of the custom domain. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain enableCustomHttps(); + + /** + * Enable https delivery of the custom domain. + * + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain enableCustomHttps(CustomDomainHttpsParameters customDomainHttpsParameters, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainHttpsParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainHttpsParameters.java new file mode 100644 index 000000000000..f6b06b551f12 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainHttpsParameters.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The JSON object that contains the properties to secure a custom domain. + */ +@Fluent +public class CustomDomainHttpsParameters implements JsonSerializable { + /* + * Defines the source of the SSL certificate. + */ + private CertificateSource certificateSource = CertificateSource.fromString("CustomDomainHttpsParameters"); + + /* + * Defines the TLS extension protocol that is used for secure delivery. + */ + private ProtocolType protocolType; + + /* + * TLS protocol version that will be used for Https + */ + private MinimumTlsVersion minimumTlsVersion; + + /** + * Creates an instance of CustomDomainHttpsParameters class. + */ + public CustomDomainHttpsParameters() { + } + + /** + * Get the certificateSource property: Defines the source of the SSL certificate. + * + * @return the certificateSource value. + */ + public CertificateSource certificateSource() { + return this.certificateSource; + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property protocolType in model CustomDomainHttpsParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainHttpsParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocolType", this.protocolType == null ? null : this.protocolType.toString()); + jsonWriter.writeStringField("certificateSource", + this.certificateSource == null ? null : this.certificateSource.toString()); + jsonWriter.writeStringField("minimumTlsVersion", + this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomainHttpsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomainHttpsParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomDomainHttpsParameters. + */ + public static CustomDomainHttpsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("certificateSource".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Cdn".equals(discriminatorValue)) { + return CdnManagedHttpsParameters.fromJson(readerToUse.reset()); + } else if ("AzureKeyVault".equals(discriminatorValue)) { + return UserManagedHttpsParameters.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static CustomDomainHttpsParameters fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomainHttpsParameters deserializedCustomDomainHttpsParameters = new CustomDomainHttpsParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocolType".equals(fieldName)) { + deserializedCustomDomainHttpsParameters.protocolType = ProtocolType.fromString(reader.getString()); + } else if ("certificateSource".equals(fieldName)) { + deserializedCustomDomainHttpsParameters.certificateSource + = CertificateSource.fromString(reader.getString()); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedCustomDomainHttpsParameters.minimumTlsVersion + = MinimumTlsVersion.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomainHttpsParameters; + }); + } +} 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 000000000000..8168e6889361 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of CDN CustomDomains within an endpoint. + */ + private List value; + + /* + * URL to get the next set of custom domain objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of CustomDomainListResult class. + */ + public CustomDomainListResult() { + } + + /** + * Get the value property: List of CDN CustomDomains within an endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of custom domain objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of custom domain objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the CustomDomainListResult object itself. + */ + public CustomDomainListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomainListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomainListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomDomainListResult. + */ + public static CustomDomainListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomainListResult deserializedCustomDomainListResult = new CustomDomainListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> CustomDomainInner.fromJson(reader1)); + deserializedCustomDomainListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCustomDomainListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomainListResult; + }); + } +} 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 000000000000..23938ea2eb0f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainPropertiesParameters; +import java.io.IOException; + +/** + * The customDomain JSON object required for custom domain creation or update. + */ +@Fluent +public final class CustomDomainParameters implements JsonSerializable { + /* + * The JSON object that contains the properties of the custom domain to create. + */ + private CustomDomainPropertiesParameters innerProperties; + + /** + * Creates an instance of CustomDomainParameters class. + */ + public CustomDomainParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the custom domain to create. + * + * @return the innerProperties value. + */ + private CustomDomainPropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the CustomDomainParameters object itself. + */ + public CustomDomainParameters withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomDomainPropertiesParameters(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomainParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomainParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomDomainParameters. + */ + public static CustomDomainParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomainParameters deserializedCustomDomainParameters = new CustomDomainParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedCustomDomainParameters.innerProperties + = CustomDomainPropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomainParameters; + }); + } +} 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 000000000000..b935e4d0f3ea --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainResourceState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource status of the custom domain. + */ +public final class CustomDomainResourceState extends ExpandableStringEnum { + /** + * Static value Creating for CustomDomainResourceState. + */ + public static final CustomDomainResourceState CREATING = fromString("Creating"); + + /** + * Static value Active for CustomDomainResourceState. + */ + public static final CustomDomainResourceState ACTIVE = fromString("Active"); + + /** + * Static value Deleting for CustomDomainResourceState. + */ + public static final CustomDomainResourceState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of CustomDomainResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomDomainResourceState() { + } + + /** + * Creates or finds a CustomDomainResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomDomainResourceState. + */ + public static CustomDomainResourceState fromString(String name) { + return fromString(name, CustomDomainResourceState.class); + } + + /** + * Gets known CustomDomainResourceState values. + * + * @return known CustomDomainResourceState values. + */ + public static Collection values() { + return values(CustomDomainResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomains.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomains.java new file mode 100644 index 000000000000..e2aceb78ad48 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomains.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CustomDomains. + */ +public interface CustomDomains { + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint. + */ + CustomDomain get(String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + CustomDomain delete(String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + CustomDomain delete(String resourceGroupName, String profileName, String endpointName, String customDomainName, + Context context); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain disableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain disableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName, Context context); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain enableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by + * default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain enableCustomHttps(String resourceGroupName, String profileName, String endpointName, + String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters, Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response}. + */ + CustomDomain getById(String id); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + CustomDomain deleteById(String id); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + CustomDomain deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomDomain resource. + * + * @param name resource name. + * @return the first stage of the new CustomDomain definition. + */ + CustomDomain.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningState.java new file mode 100644 index 000000000000..d59752a7d4bf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning status of the custom domain. + */ +public final class CustomHttpsProvisioningState extends ExpandableStringEnum { + /** + * Static value Enabling for CustomHttpsProvisioningState. + */ + public static final CustomHttpsProvisioningState ENABLING = fromString("Enabling"); + + /** + * Static value Enabled for CustomHttpsProvisioningState. + */ + public static final CustomHttpsProvisioningState ENABLED = fromString("Enabled"); + + /** + * Static value Disabling for CustomHttpsProvisioningState. + */ + public static final CustomHttpsProvisioningState DISABLING = fromString("Disabling"); + + /** + * Static value Disabled for CustomHttpsProvisioningState. + */ + public static final CustomHttpsProvisioningState DISABLED = fromString("Disabled"); + + /** + * Static value Failed for CustomHttpsProvisioningState. + */ + public static final CustomHttpsProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of CustomHttpsProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomHttpsProvisioningState() { + } + + /** + * Creates or finds a CustomHttpsProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomHttpsProvisioningState. + */ + public static CustomHttpsProvisioningState fromString(String name) { + return fromString(name, CustomHttpsProvisioningState.class); + } + + /** + * Gets known CustomHttpsProvisioningState values. + * + * @return known CustomHttpsProvisioningState values. + */ + public static Collection values() { + return values(CustomHttpsProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningSubstate.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningSubstate.java new file mode 100644 index 000000000000..ac415e3c3612 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningSubstate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 java.util.Collection; + +/** + * Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. + */ +public final class CustomHttpsProvisioningSubstate extends ExpandableStringEnum { + /** + * Static value SubmittingDomainControlValidationRequest for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate SUBMITTING_DOMAIN_CONTROL_VALIDATION_REQUEST + = fromString("SubmittingDomainControlValidationRequest"); + + /** + * Static value PendingDomainControlValidationREquestApproval for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate PENDING_DOMAIN_CONTROL_VALIDATION_REQUEST_APPROVAL + = fromString("PendingDomainControlValidationREquestApproval"); + + /** + * Static value DomainControlValidationRequestApproved for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_APPROVED + = fromString("DomainControlValidationRequestApproved"); + + /** + * Static value DomainControlValidationRequestRejected for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_REJECTED + = fromString("DomainControlValidationRequestRejected"); + + /** + * Static value DomainControlValidationRequestTimedOut for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_TIMED_OUT + = fromString("DomainControlValidationRequestTimedOut"); + + /** + * Static value IssuingCertificate for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate ISSUING_CERTIFICATE = fromString("IssuingCertificate"); + + /** + * Static value DeployingCertificate for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate DEPLOYING_CERTIFICATE = fromString("DeployingCertificate"); + + /** + * Static value CertificateDeployed for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate CERTIFICATE_DEPLOYED = fromString("CertificateDeployed"); + + /** + * Static value DeletingCertificate for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate DELETING_CERTIFICATE = fromString("DeletingCertificate"); + + /** + * Static value CertificateDeleted for CustomHttpsProvisioningSubstate. + */ + public static final CustomHttpsProvisioningSubstate CERTIFICATE_DELETED = fromString("CertificateDeleted"); + + /** + * Creates a new instance of CustomHttpsProvisioningSubstate value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomHttpsProvisioningSubstate() { + } + + /** + * Creates or finds a CustomHttpsProvisioningSubstate from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomHttpsProvisioningSubstate. + */ + public static CustomHttpsProvisioningSubstate fromString(String name) { + return fromString(name, CustomHttpsProvisioningSubstate.class); + } + + /** + * Gets known CustomHttpsProvisioningSubstate values. + * + * @return known CustomHttpsProvisioningSubstate values. + */ + public static Collection values() { + return values(CustomHttpsProvisioningSubstate.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRule.java new file mode 100644 index 000000000000..d7d5dc91fc68 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRule.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the common attributes for a custom rule that can be included in a waf policy. + */ +@Fluent +public class CustomRule implements JsonSerializable { + /* + * Defines the name of the custom rule + */ + private String name; + + /* + * Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. + */ + private CustomRuleEnabledState enabledState; + + /* + * Defines in what order this rule be evaluated in the overall list of custom rules + */ + private int priority; + + /* + * List of match conditions. + */ + private List matchConditions; + + /* + * Describes what action to be applied when rule matches + */ + private ActionType action; + + /** + * Creates an instance of CustomRule class. + */ + public CustomRule() { + } + + /** + * Get the name property: Defines the name of the custom rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Defines the name of the custom rule. + * + * @param name the name value to set. + * @return the CustomRule object itself. + */ + public CustomRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the enabledState property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled + * if not specified. + * + * @return the enabledState value. + */ + public CustomRuleEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled + * if not specified. + * + * @param enabledState the enabledState value to set. + * @return the CustomRule object itself. + */ + public CustomRule withEnabledState(CustomRuleEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the priority property: Defines in what order this rule be evaluated in the overall list of custom rules. + * + * @return the priority value. + */ + public int priority() { + return this.priority; + } + + /** + * Set the priority property: Defines in what order this rule be evaluated in the overall list of custom rules. + * + * @param priority the priority value to set. + * @return the CustomRule object itself. + */ + public CustomRule withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get the matchConditions property: List of match conditions. + * + * @return the matchConditions value. + */ + public List matchConditions() { + return this.matchConditions; + } + + /** + * Set the matchConditions property: List of match conditions. + * + * @param matchConditions the matchConditions value to set. + * @return the CustomRule object itself. + */ + public CustomRule withMatchConditions(List matchConditions) { + this.matchConditions = matchConditions; + return this; + } + + /** + * Get the action property: Describes what action to be applied when rule matches. + * + * @return the action value. + */ + public ActionType action() { + return this.action; + } + + /** + * Set the action property: Describes what action to be applied when rule matches. + * + * @param action the action value to set. + * @return the CustomRule object itself. + */ + public CustomRule withAction(ActionType action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model CustomRule")); + } + if (matchConditions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property matchConditions in model CustomRule")); + } else { + matchConditions().forEach(e -> e.validate()); + } + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model CustomRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeIntField("priority", this.priority); + jsonWriter.writeArrayField("matchConditions", this.matchConditions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("enabledState", this.enabledState == null ? null : this.enabledState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomRule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomRule. + */ + public static CustomRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomRule deserializedCustomRule = new CustomRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustomRule.name = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedCustomRule.priority = reader.getInt(); + } else if ("matchConditions".equals(fieldName)) { + List matchConditions + = reader.readArray(reader1 -> MatchCondition.fromJson(reader1)); + deserializedCustomRule.matchConditions = matchConditions; + } else if ("action".equals(fieldName)) { + deserializedCustomRule.action = ActionType.fromString(reader.getString()); + } else if ("enabledState".equals(fieldName)) { + deserializedCustomRule.enabledState = CustomRuleEnabledState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomRule; + }); + } +} 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 000000000000..f75f6cd856eb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleEnabledState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. + */ +public final class CustomRuleEnabledState extends ExpandableStringEnum { + /** + * Static value Disabled for CustomRuleEnabledState. + */ + public static final CustomRuleEnabledState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for CustomRuleEnabledState. + */ + public static final CustomRuleEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of CustomRuleEnabledState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomRuleEnabledState() { + } + + /** + * Creates or finds a CustomRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomRuleEnabledState. + */ + public static CustomRuleEnabledState fromString(String name) { + return fromString(name, CustomRuleEnabledState.class); + } + + /** + * Gets known CustomRuleEnabledState values. + * + * @return known CustomRuleEnabledState values. + */ + public static Collection values() { + return values(CustomRuleEnabledState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleList.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleList.java new file mode 100644 index 000000000000..1c1094db0d45 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleList.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines contents of custom rules. + */ +@Fluent +public final class CustomRuleList implements JsonSerializable { + /* + * List of rules + */ + private List rules; + + /** + * Creates an instance of CustomRuleList class. + */ + public CustomRuleList() { + } + + /** + * Get the rules property: List of rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules. + * + * @param rules the rules value to set. + * @return the CustomRuleList object itself. + */ + public CustomRuleList withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomRuleList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomRuleList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomRuleList. + */ + public static CustomRuleList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomRuleList deserializedCustomRuleList = new CustomRuleList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> CustomRule.fromJson(reader1)); + deserializedCustomRuleList.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedCustomRuleList; + }); + } +} 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 000000000000..2ee4fd4e9df8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificate.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Customer Certificate used for https. + */ +@Fluent +public final class CustomerCertificate extends Certificate { + /* + * Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + */ + private ResourceReference secretSource; + + /* + * Certificate version. + */ + private String secretVersion; + + /* + * Certificate issuing authority. + */ + private String certificateAuthority; + + /* + * Whether to use the latest version for the certificate + */ + private Boolean useLatestVersion; + + /* + * The list of SANs. + */ + private List subjectAlternativeNames; + + /* + * Certificate thumbprint. + */ + private String thumbprint; + + /* + * Certificate expiration date. + */ + private String expirationDate; + + /* + * Subject name in the certificate. + */ + private String subject; + + /** + * Creates an instance of CustomerCertificate class. + */ + public CustomerCertificate() { + } + + /** + * Get the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @param secretSource the secretSource value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withSecretSource(ResourceReference secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Get the secretVersion property: Certificate version. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: Certificate version. + * + * @param secretVersion the secretVersion value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Get the certificateAuthority property: Certificate issuing authority. + * + * @return the certificateAuthority value. + */ + public String certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Get the useLatestVersion property: Whether to use the latest version for the certificate. + * + * @return the useLatestVersion value. + */ + public Boolean useLatestVersion() { + return this.useLatestVersion; + } + + /** + * Set the useLatestVersion property: Whether to use the latest version for the certificate. + * + * @param useLatestVersion the useLatestVersion value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withUseLatestVersion(Boolean useLatestVersion) { + this.useLatestVersion = useLatestVersion; + return this; + } + + /** + * Get the subjectAlternativeNames property: The list of SANs. + * + * @return the subjectAlternativeNames value. + */ + public List subjectAlternativeNames() { + return this.subjectAlternativeNames; + } + + /** + * Set the subjectAlternativeNames property: The list of SANs. + * + * @param subjectAlternativeNames the subjectAlternativeNames value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withSubjectAlternativeNames(List subjectAlternativeNames) { + this.subjectAlternativeNames = subjectAlternativeNames; + return this; + } + + /** + * Get the thumbprint property: Certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + @Override + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + @Override + public String subject() { + return this.subject; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomerCertificate withType(SecretType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (secretSource() != null) { + secretSource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + jsonWriter.writeJsonField("secretSource", this.secretSource); + jsonWriter.writeStringField("secretVersion", this.secretVersion); + jsonWriter.writeBooleanField("useLatestVersion", this.useLatestVersion); + jsonWriter.writeArrayField("subjectAlternativeNames", this.subjectAlternativeNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomerCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomerCertificate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomerCertificate. + */ + public static CustomerCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomerCertificate deserializedCustomerCertificate = new CustomerCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedCustomerCertificate.withType(SecretType.fromString(reader.getString())); + } else if ("subject".equals(fieldName)) { + deserializedCustomerCertificate.subject = reader.getString(); + } else if ("expirationDate".equals(fieldName)) { + deserializedCustomerCertificate.expirationDate = reader.getString(); + } else if ("secretSource".equals(fieldName)) { + deserializedCustomerCertificate.secretSource = ResourceReference.fromJson(reader); + } else if ("secretVersion".equals(fieldName)) { + deserializedCustomerCertificate.secretVersion = reader.getString(); + } else if ("certificateAuthority".equals(fieldName)) { + deserializedCustomerCertificate.certificateAuthority = reader.getString(); + } else if ("useLatestVersion".equals(fieldName)) { + deserializedCustomerCertificate.useLatestVersion = reader.getNullable(JsonReader::getBoolean); + } else if ("subjectAlternativeNames".equals(fieldName)) { + List subjectAlternativeNames = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomerCertificate.subjectAlternativeNames = subjectAlternativeNames; + } else if ("thumbprint".equals(fieldName)) { + deserializedCustomerCertificate.thumbprint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomerCertificate; + }); + } +} 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 000000000000..51597225dd7e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificateParameters.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Customer Certificate used for https. + */ +@Fluent +public final class CustomerCertificateParameters extends SecretParameters { + /* + * The type of the secret resource. + */ + private SecretType type = SecretType.CUSTOMER_CERTIFICATE; + + /* + * Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + */ + private ResourceReference secretSource; + + /* + * Version of the secret to be used + */ + private String secretVersion; + + /* + * Whether to use the latest version for the certificate + */ + private Boolean useLatestVersion; + + /* + * Subject name in the certificate. + */ + private String subject; + + /* + * Certificate expiration date. + */ + private String expirationDate; + + /* + * Certificate issuing authority. + */ + private String certificateAuthority; + + /* + * The list of SANs. + */ + private List subjectAlternativeNames; + + /* + * Certificate thumbprint. + */ + private String thumbprint; + + /** + * Creates an instance of CustomerCertificateParameters class. + */ + public CustomerCertificateParameters() { + } + + /** + * Get the type property: The type of the secret resource. + * + * @return the type value. + */ + @Override + public SecretType type() { + return this.type; + } + + /** + * Get the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @param secretSource the secretSource value to set. + * @return the CustomerCertificateParameters object itself. + */ + public CustomerCertificateParameters withSecretSource(ResourceReference secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Get the secretVersion property: Version of the secret to be used. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: Version of the secret to be used. + * + * @param secretVersion the secretVersion value to set. + * @return the CustomerCertificateParameters object itself. + */ + public CustomerCertificateParameters withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Get the useLatestVersion property: Whether to use the latest version for the certificate. + * + * @return the useLatestVersion value. + */ + public Boolean useLatestVersion() { + return this.useLatestVersion; + } + + /** + * Set the useLatestVersion property: Whether to use the latest version for the certificate. + * + * @param useLatestVersion the useLatestVersion value to set. + * @return the CustomerCertificateParameters object itself. + */ + public CustomerCertificateParameters withUseLatestVersion(Boolean useLatestVersion) { + this.useLatestVersion = useLatestVersion; + return this; + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the certificateAuthority property: Certificate issuing authority. + * + * @return the certificateAuthority value. + */ + public String certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Get the subjectAlternativeNames property: The list of SANs. + * + * @return the subjectAlternativeNames value. + */ + public List subjectAlternativeNames() { + return this.subjectAlternativeNames; + } + + /** + * Set the subjectAlternativeNames property: The list of SANs. + * + * @param subjectAlternativeNames the subjectAlternativeNames value to set. + * @return the CustomerCertificateParameters object itself. + */ + public CustomerCertificateParameters withSubjectAlternativeNames(List subjectAlternativeNames) { + this.subjectAlternativeNames = subjectAlternativeNames; + return this; + } + + /** + * Get the thumbprint property: Certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (secretSource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secretSource in model CustomerCertificateParameters")); + } else { + secretSource().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomerCertificateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("secretSource", this.secretSource); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("secretVersion", this.secretVersion); + jsonWriter.writeBooleanField("useLatestVersion", this.useLatestVersion); + jsonWriter.writeArrayField("subjectAlternativeNames", this.subjectAlternativeNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomerCertificateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomerCertificateParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomerCertificateParameters. + */ + public static CustomerCertificateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomerCertificateParameters deserializedCustomerCertificateParameters + = new CustomerCertificateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretSource".equals(fieldName)) { + deserializedCustomerCertificateParameters.secretSource = ResourceReference.fromJson(reader); + } else if ("type".equals(fieldName)) { + deserializedCustomerCertificateParameters.type = SecretType.fromString(reader.getString()); + } else if ("secretVersion".equals(fieldName)) { + deserializedCustomerCertificateParameters.secretVersion = reader.getString(); + } else if ("useLatestVersion".equals(fieldName)) { + deserializedCustomerCertificateParameters.useLatestVersion + = reader.getNullable(JsonReader::getBoolean); + } else if ("subject".equals(fieldName)) { + deserializedCustomerCertificateParameters.subject = reader.getString(); + } else if ("expirationDate".equals(fieldName)) { + deserializedCustomerCertificateParameters.expirationDate = reader.getString(); + } else if ("certificateAuthority".equals(fieldName)) { + deserializedCustomerCertificateParameters.certificateAuthority = reader.getString(); + } else if ("subjectAlternativeNames".equals(fieldName)) { + List subjectAlternativeNames = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomerCertificateParameters.subjectAlternativeNames = subjectAlternativeNames; + } else if ("thumbprint".equals(fieldName)) { + deserializedCustomerCertificateParameters.thumbprint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomerCertificateParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedCustomDomain.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedCustomDomain.java new file mode 100644 index 000000000000..da4bdc6cc2f2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedCustomDomain.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.DeepCreatedCustomDomainProperties; +import java.io.IOException; + +/** + * Custom domains created on the CDN endpoint. + */ +@Fluent +public final class DeepCreatedCustomDomain implements JsonSerializable { + /* + * Custom domain name. + */ + private String name; + + /* + * Properties of the custom domain created on the CDN endpoint. + */ + private DeepCreatedCustomDomainProperties innerProperties; + + /** + * Creates an instance of DeepCreatedCustomDomain class. + */ + public DeepCreatedCustomDomain() { + } + + /** + * Get the name property: Custom domain name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Custom domain name. + * + * @param name the name value to set. + * @return the DeepCreatedCustomDomain object itself. + */ + public DeepCreatedCustomDomain withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Properties of the custom domain created on the CDN endpoint. + * + * @return the innerProperties value. + */ + private DeepCreatedCustomDomainProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the DeepCreatedCustomDomain object itself. + */ + public DeepCreatedCustomDomain withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedCustomDomainProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + public String validationData() { + return this.innerProperties() == null ? null : this.innerProperties().validationData(); + } + + /** + * Set the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @param validationData the validationData value to set. + * @return the DeepCreatedCustomDomain object itself. + */ + public DeepCreatedCustomDomain withValidationData(String validationData) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedCustomDomainProperties(); + } + this.innerProperties().withValidationData(validationData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model DeepCreatedCustomDomain")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedCustomDomain.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeepCreatedCustomDomain from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeepCreatedCustomDomain if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeepCreatedCustomDomain. + */ + public static DeepCreatedCustomDomain fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeepCreatedCustomDomain deserializedDeepCreatedCustomDomain = new DeepCreatedCustomDomain(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDeepCreatedCustomDomain.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeepCreatedCustomDomain.innerProperties + = DeepCreatedCustomDomainProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeepCreatedCustomDomain; + }); + } +} 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 000000000000..fb89c6302a5f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOrigin.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.DeepCreatedOriginProperties; +import java.io.IOException; + +/** + * The main origin of CDN content which is added when creating a CDN endpoint. + */ +@Fluent +public final class DeepCreatedOrigin implements JsonSerializable { + /* + * Origin name which must be unique within the endpoint. + */ + private String name; + + /* + * Properties of the origin created on the CDN endpoint. + */ + private DeepCreatedOriginProperties innerProperties; + + /** + * Creates an instance of DeepCreatedOrigin class. + */ + public DeepCreatedOrigin() { + } + + /** + * Get the name property: Origin name which must be unique within the endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Origin name which must be unique within the endpoint. + * + * @param name the name value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Properties of the origin created on the CDN endpoint. + * + * @return the innerProperties value. + */ + private DeepCreatedOriginProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the hostname property: The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. By default, origin is always enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. By default, origin is always enabled. + * + * @param enabled the enabled value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkAlias(); + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPrivateLinkAlias(String privateLinkAlias) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPrivateLinkAlias(privateLinkAlias); + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId(); + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPrivateLinkResourceId(String privateLinkResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkLocation(); + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPrivateLinkLocation(String privateLinkLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPrivateLinkLocation(privateLinkLocation); + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkApprovalMessage(); + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + return this; + } + + /** + * Get the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + public PrivateEndpointStatus privateEndpointStatus() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model DeepCreatedOrigin")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedOrigin.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeepCreatedOrigin from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeepCreatedOrigin if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeepCreatedOrigin. + */ + public static DeepCreatedOrigin fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeepCreatedOrigin deserializedDeepCreatedOrigin = new DeepCreatedOrigin(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDeepCreatedOrigin.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeepCreatedOrigin.innerProperties = DeepCreatedOriginProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeepCreatedOrigin; + }); + } +} 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 000000000000..ea45ee83488f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOriginGroup.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.DeepCreatedOriginGroupProperties; +import java.io.IOException; +import java.util.List; + +/** + * The origin group for CDN content which is added when creating a CDN endpoint. Traffic is sent to the origins within + * the origin group based on origin health. + */ +@Fluent +public final class DeepCreatedOriginGroup implements JsonSerializable { + /* + * Origin group name which must be unique within the endpoint. + */ + private String name; + + /* + * Properties of the origin group created on the CDN endpoint. + */ + private DeepCreatedOriginGroupProperties innerProperties; + + /** + * Creates an instance of DeepCreatedOriginGroup class. + */ + public DeepCreatedOriginGroup() { + } + + /** + * Get the name property: Origin group name which must be unique within the endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Origin group name which must be unique within the endpoint. + * + * @param name the name value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Properties of the origin group created on the CDN endpoint. + * + * @return the innerProperties value. + */ + private DeepCreatedOriginGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginGroupProperties(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.innerProperties() == null ? null : this.innerProperties().origins(); + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withOrigins(List origins) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginGroupProperties(); + } + this.innerProperties().withOrigins(origins); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginGroupProperties(); + } + this.innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses.This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.innerProperties() == null + ? null + : this.innerProperties().responseBasedOriginErrorDetectionSettings(); + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses.This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginGroupProperties(); + } + this.innerProperties().withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model DeepCreatedOriginGroup")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedOriginGroup.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeepCreatedOriginGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeepCreatedOriginGroup if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeepCreatedOriginGroup. + */ + public static DeepCreatedOriginGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeepCreatedOriginGroup deserializedDeepCreatedOriginGroup = new DeepCreatedOriginGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDeepCreatedOriginGroup.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeepCreatedOriginGroup.innerProperties + = DeepCreatedOriginGroupProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeepCreatedOriginGroup; + }); + } +} 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 000000000000..11005a8b34a1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeleteRule.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 java.util.Collection; + +/** + * Describes the action that shall be taken when the certificate is removed from Key Vault. + */ +public final class DeleteRule extends ExpandableStringEnum { + /** + * Static value NoAction for DeleteRule. + */ + public static final DeleteRule NO_ACTION = fromString("NoAction"); + + /** + * Creates a new instance of DeleteRule value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeleteRule() { + } + + /** + * Creates or finds a DeleteRule from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteRule. + */ + public static DeleteRule fromString(String name) { + return fromString(name, DeleteRule.class); + } + + /** + * Gets known DeleteRule values. + * + * @return known DeleteRule values. + */ + public static Collection values() { + return values(DeleteRule.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRule.java new file mode 100644 index 000000000000..e7d718898e4e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRule.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A rule that specifies a set of actions and conditions. + */ +@Fluent +public final class DeliveryRule implements JsonSerializable { + /* + * Name of the rule + */ + 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. + */ + private int order; + + /* + * A list of conditions that must be matched for the actions to be executed + */ + private List conditions; + + /* + * A list of actions that are executed when all the conditions of a rule are satisfied. + */ + private List actions; + + /** + * Creates an instance of DeliveryRule class. + */ + public DeliveryRule() { + } + + /** + * Get the name property: Name of the rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the rule. + * + * @param name the name value to set. + * @return the DeliveryRule object itself. + */ + public DeliveryRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value. + */ + public int order() { + return this.order; + } + + /** + * Set the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @param order the order value to set. + * @return the DeliveryRule object itself. + */ + public DeliveryRule withOrder(int order) { + this.order = order; + return this; + } + + /** + * Get the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @param conditions the conditions value to set. + * @return the DeliveryRule object itself. + */ + public DeliveryRule withConditions(List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Get the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @param actions the actions value to set. + * @return the DeliveryRule object itself. + */ + public DeliveryRule withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + if (actions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property actions in model DeliveryRule")); + } else { + actions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("order", this.order); + jsonWriter.writeArrayField("actions", this.actions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("conditions", this.conditions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRule. + */ + public static DeliveryRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRule deserializedDeliveryRule = new DeliveryRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("order".equals(fieldName)) { + deserializedDeliveryRule.order = reader.getInt(); + } else if ("actions".equals(fieldName)) { + List actions + = reader.readArray(reader1 -> DeliveryRuleAction.fromJson(reader1)); + deserializedDeliveryRule.actions = actions; + } else if ("name".equals(fieldName)) { + deserializedDeliveryRule.name = reader.getString(); + } else if ("conditions".equals(fieldName)) { + List conditions + = reader.readArray(reader1 -> DeliveryRuleCondition.fromJson(reader1)); + deserializedDeliveryRule.conditions = conditions; + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRule; + }); + } +} 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 000000000000..c7c96ffc1578 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleAction.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An action for the delivery rule. + */ +@Immutable +public class DeliveryRuleAction implements JsonSerializable { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.fromString("DeliveryRuleAction"); + + /** + * Creates an instance of DeliveryRuleAction class. + */ + public DeliveryRuleAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleAction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeliveryRuleAction. + */ + public static DeliveryRuleAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("name".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("UrlRedirect".equals(discriminatorValue)) { + return UrlRedirectAction.fromJson(readerToUse.reset()); + } else if ("UrlSigning".equals(discriminatorValue)) { + return UrlSigningAction.fromJson(readerToUse.reset()); + } else if ("OriginGroupOverride".equals(discriminatorValue)) { + return OriginGroupOverrideAction.fromJson(readerToUse.reset()); + } else if ("UrlRewrite".equals(discriminatorValue)) { + return UrlRewriteAction.fromJson(readerToUse.reset()); + } else if ("ModifyRequestHeader".equals(discriminatorValue)) { + return DeliveryRuleRequestHeaderAction.fromJson(readerToUse.reset()); + } else if ("ModifyResponseHeader".equals(discriminatorValue)) { + return DeliveryRuleResponseHeaderAction.fromJson(readerToUse.reset()); + } else if ("CacheExpiration".equals(discriminatorValue)) { + return DeliveryRuleCacheExpirationAction.fromJson(readerToUse.reset()); + } else if ("CacheKeyQueryString".equals(discriminatorValue)) { + return DeliveryRuleCacheKeyQueryStringAction.fromJson(readerToUse.reset()); + } else if ("RouteConfigurationOverride".equals(discriminatorValue)) { + return DeliveryRuleRouteConfigurationOverrideAction.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DeliveryRuleAction fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleAction deserializedDeliveryRuleAction = new DeliveryRuleAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDeliveryRuleAction.name = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleAction; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionParameters.java new file mode 100644 index 000000000000..4f9f71c3d05f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionParameters.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for delivery rule actions. + */ +@Immutable +public class DeliveryRuleActionParameters implements JsonSerializable { + /* + * The typeName property. + */ + private DeliveryRuleActionParametersType typeName + = DeliveryRuleActionParametersType.fromString("DeliveryRuleActionParameters"); + + /** + * Creates an instance of DeliveryRuleActionParameters class. + */ + public DeliveryRuleActionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public DeliveryRuleActionParametersType typeName() { + return this.typeName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleActionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleActionParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeliveryRuleActionParameters. + */ + public static DeliveryRuleActionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("typeName".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("DeliveryRuleUrlRedirectActionParameters".equals(discriminatorValue)) { + return UrlRedirectActionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleUrlSigningActionParameters".equals(discriminatorValue)) { + return UrlSigningActionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleOriginGroupOverrideActionParameters".equals(discriminatorValue)) { + return OriginGroupOverrideActionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleUrlRewriteActionParameters".equals(discriminatorValue)) { + return UrlRewriteActionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleHeaderActionParameters".equals(discriminatorValue)) { + return HeaderActionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleCacheExpirationActionParameters".equals(discriminatorValue)) { + return CacheExpirationActionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleCacheKeyQueryStringBehaviorActionParameters".equals(discriminatorValue)) { + return CacheKeyQueryStringActionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleRouteConfigurationOverrideActionParameters".equals(discriminatorValue)) { + return RouteConfigurationOverrideActionParameters.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DeliveryRuleActionParameters fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleActionParameters deserializedDeliveryRuleActionParameters = new DeliveryRuleActionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("typeName".equals(fieldName)) { + deserializedDeliveryRuleActionParameters.typeName + = DeliveryRuleActionParametersType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleActionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionParametersType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionParametersType.java new file mode 100644 index 000000000000..62c18ae8d80a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionParametersType.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for DeliveryRuleActionParametersType. + */ +public final class DeliveryRuleActionParametersType extends ExpandableStringEnum { + /** + * Static value DeliveryRuleUrlRedirectActionParameters for DeliveryRuleActionParametersType. + */ + public static final DeliveryRuleActionParametersType DELIVERY_RULE_URL_REDIRECT_ACTION_PARAMETERS + = fromString("DeliveryRuleUrlRedirectActionParameters"); + + /** + * Static value DeliveryRuleUrlSigningActionParameters for DeliveryRuleActionParametersType. + */ + public static final DeliveryRuleActionParametersType DELIVERY_RULE_URL_SIGNING_ACTION_PARAMETERS + = fromString("DeliveryRuleUrlSigningActionParameters"); + + /** + * Static value DeliveryRuleOriginGroupOverrideActionParameters for DeliveryRuleActionParametersType. + */ + public static final DeliveryRuleActionParametersType DELIVERY_RULE_ORIGIN_GROUP_OVERRIDE_ACTION_PARAMETERS + = fromString("DeliveryRuleOriginGroupOverrideActionParameters"); + + /** + * Static value DeliveryRuleUrlRewriteActionParameters for DeliveryRuleActionParametersType. + */ + public static final DeliveryRuleActionParametersType DELIVERY_RULE_URL_REWRITE_ACTION_PARAMETERS + = fromString("DeliveryRuleUrlRewriteActionParameters"); + + /** + * Static value DeliveryRuleHeaderActionParameters for DeliveryRuleActionParametersType. + */ + public static final DeliveryRuleActionParametersType DELIVERY_RULE_HEADER_ACTION_PARAMETERS + = fromString("DeliveryRuleHeaderActionParameters"); + + /** + * Static value DeliveryRuleCacheExpirationActionParameters for DeliveryRuleActionParametersType. + */ + public static final DeliveryRuleActionParametersType DELIVERY_RULE_CACHE_EXPIRATION_ACTION_PARAMETERS + = fromString("DeliveryRuleCacheExpirationActionParameters"); + + /** + * Static value DeliveryRuleCacheKeyQueryStringBehaviorActionParameters for DeliveryRuleActionParametersType. + */ + public static final DeliveryRuleActionParametersType DELIVERY_RULE_CACHE_KEY_QUERY_STRING_BEHAVIOR_ACTION_PARAMETERS + = fromString("DeliveryRuleCacheKeyQueryStringBehaviorActionParameters"); + + /** + * Static value DeliveryRuleRouteConfigurationOverrideActionParameters for DeliveryRuleActionParametersType. + */ + public static final DeliveryRuleActionParametersType DELIVERY_RULE_ROUTE_CONFIGURATION_OVERRIDE_ACTION_PARAMETERS + = fromString("DeliveryRuleRouteConfigurationOverrideActionParameters"); + + /** + * Creates a new instance of DeliveryRuleActionParametersType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeliveryRuleActionParametersType() { + } + + /** + * Creates or finds a DeliveryRuleActionParametersType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeliveryRuleActionParametersType. + */ + public static DeliveryRuleActionParametersType fromString(String name) { + return fromString(name, DeliveryRuleActionParametersType.class); + } + + /** + * Gets known DeliveryRuleActionParametersType values. + * + * @return known DeliveryRuleActionParametersType values. + */ + public static Collection values() { + return values(DeliveryRuleActionParametersType.class); + } +} 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 000000000000..4d552601aff9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionValue.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The name of the action for the delivery rule. + */ +public final class DeliveryRuleActionValue extends ExpandableStringEnum { + /** + * Static value CacheExpiration for DeliveryRuleActionValue. + */ + public static final DeliveryRuleActionValue CACHE_EXPIRATION = fromString("CacheExpiration"); + + /** + * Static value CacheKeyQueryString for DeliveryRuleActionValue. + */ + public static final DeliveryRuleActionValue CACHE_KEY_QUERY_STRING = fromString("CacheKeyQueryString"); + + /** + * Static value ModifyRequestHeader for DeliveryRuleActionValue. + */ + public static final DeliveryRuleActionValue MODIFY_REQUEST_HEADER = fromString("ModifyRequestHeader"); + + /** + * Static value ModifyResponseHeader for DeliveryRuleActionValue. + */ + public static final DeliveryRuleActionValue MODIFY_RESPONSE_HEADER = fromString("ModifyResponseHeader"); + + /** + * Static value UrlRedirect for DeliveryRuleActionValue. + */ + public static final DeliveryRuleActionValue URL_REDIRECT = fromString("UrlRedirect"); + + /** + * Static value UrlRewrite for DeliveryRuleActionValue. + */ + public static final DeliveryRuleActionValue URL_REWRITE = fromString("UrlRewrite"); + + /** + * Static value UrlSigning for DeliveryRuleActionValue. + */ + public static final DeliveryRuleActionValue URL_SIGNING = fromString("UrlSigning"); + + /** + * Static value OriginGroupOverride for DeliveryRuleActionValue. + */ + public static final DeliveryRuleActionValue ORIGIN_GROUP_OVERRIDE = fromString("OriginGroupOverride"); + + /** + * Static value RouteConfigurationOverride for DeliveryRuleActionValue. + */ + public static final DeliveryRuleActionValue ROUTE_CONFIGURATION_OVERRIDE = fromString("RouteConfigurationOverride"); + + /** + * Creates a new instance of DeliveryRuleActionValue value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeliveryRuleActionValue() { + } + + /** + * Creates or finds a DeliveryRuleActionValue from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeliveryRuleActionValue. + */ + public static DeliveryRuleActionValue fromString(String name) { + return fromString(name, DeliveryRuleActionValue.class); + } + + /** + * Gets known DeliveryRuleActionValue values. + * + * @return known DeliveryRuleActionValue values. + */ + public static Collection values() { + return values(DeliveryRuleActionValue.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheExpirationAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheExpirationAction.java new file mode 100644 index 000000000000..61eb4e68a42c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheExpirationAction.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the cache expiration action for the delivery rule. + */ +@Fluent +public final class DeliveryRuleCacheExpirationAction extends DeliveryRuleAction { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.CACHE_EXPIRATION; + + /* + * Defines the parameters for the action. + */ + private CacheExpirationActionParameters parameters; + + /** + * Creates an instance of DeliveryRuleCacheExpirationAction class. + */ + public DeliveryRuleCacheExpirationAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + @Override + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleCacheExpirationAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleCacheExpirationAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleCacheExpirationAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleCacheExpirationAction if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleCacheExpirationAction. + */ + public static DeliveryRuleCacheExpirationAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleCacheExpirationAction deserializedDeliveryRuleCacheExpirationAction + = new DeliveryRuleCacheExpirationAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleCacheExpirationAction.parameters + = CacheExpirationActionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleCacheExpirationAction.name + = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleCacheExpirationAction; + }); + } +} 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 000000000000..d166f6497297 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheKeyQueryStringAction.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the cache-key query string action for the delivery rule. + */ +@Fluent +public final class DeliveryRuleCacheKeyQueryStringAction extends DeliveryRuleAction { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.CACHE_KEY_QUERY_STRING; + + /* + * Defines the parameters for the action. + */ + private CacheKeyQueryStringActionParameters parameters; + + /** + * Creates an instance of DeliveryRuleCacheKeyQueryStringAction class. + */ + public DeliveryRuleCacheKeyQueryStringAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + @Override + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleCacheKeyQueryStringAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleCacheKeyQueryStringAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleCacheKeyQueryStringAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleCacheKeyQueryStringAction if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleCacheKeyQueryStringAction. + */ + public static DeliveryRuleCacheKeyQueryStringAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleCacheKeyQueryStringAction deserializedDeliveryRuleCacheKeyQueryStringAction + = new DeliveryRuleCacheKeyQueryStringAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleCacheKeyQueryStringAction.parameters + = CacheKeyQueryStringActionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleCacheKeyQueryStringAction.name + = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleCacheKeyQueryStringAction; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleClientPortCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleClientPortCondition.java new file mode 100644 index 000000000000..a991bcd759ce --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleClientPortCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the ClientPort condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleClientPortCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.CLIENT_PORT; + + /* + * Defines the parameters for the condition. + */ + private ClientPortMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleClientPortCondition class. + */ + public DeliveryRuleClientPortCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public ClientPortMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleClientPortCondition object itself. + */ + public DeliveryRuleClientPortCondition withParameters(ClientPortMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleClientPortCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleClientPortCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleClientPortCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleClientPortCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleClientPortCondition. + */ + public static DeliveryRuleClientPortCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleClientPortCondition deserializedDeliveryRuleClientPortCondition + = new DeliveryRuleClientPortCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleClientPortCondition.parameters + = ClientPortMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleClientPortCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleClientPortCondition; + }); + } +} 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 000000000000..ea1419094d3e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCondition.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A condition for the delivery rule. + */ +@Immutable +public class DeliveryRuleCondition implements JsonSerializable { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.fromString("DeliveryRuleCondition"); + + /** + * Creates an instance of DeliveryRuleCondition class. + */ + public DeliveryRuleCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + public MatchVariable name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleCondition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeliveryRuleCondition. + */ + public static DeliveryRuleCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("name".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("RemoteAddress".equals(discriminatorValue)) { + return DeliveryRuleRemoteAddressCondition.fromJson(readerToUse.reset()); + } else if ("RequestMethod".equals(discriminatorValue)) { + return DeliveryRuleRequestMethodCondition.fromJson(readerToUse.reset()); + } else if ("QueryString".equals(discriminatorValue)) { + return DeliveryRuleQueryStringCondition.fromJson(readerToUse.reset()); + } else if ("PostArgs".equals(discriminatorValue)) { + return DeliveryRulePostArgsCondition.fromJson(readerToUse.reset()); + } else if ("RequestUri".equals(discriminatorValue)) { + return DeliveryRuleRequestUriCondition.fromJson(readerToUse.reset()); + } else if ("RequestHeader".equals(discriminatorValue)) { + return DeliveryRuleRequestHeaderCondition.fromJson(readerToUse.reset()); + } else if ("RequestBody".equals(discriminatorValue)) { + return DeliveryRuleRequestBodyCondition.fromJson(readerToUse.reset()); + } else if ("RequestScheme".equals(discriminatorValue)) { + return DeliveryRuleRequestSchemeCondition.fromJson(readerToUse.reset()); + } else if ("UrlPath".equals(discriminatorValue)) { + return DeliveryRuleUrlPathCondition.fromJson(readerToUse.reset()); + } else if ("UrlFileExtension".equals(discriminatorValue)) { + return DeliveryRuleUrlFileExtensionCondition.fromJson(readerToUse.reset()); + } else if ("UrlFileName".equals(discriminatorValue)) { + return DeliveryRuleUrlFileNameCondition.fromJson(readerToUse.reset()); + } else if ("HttpVersion".equals(discriminatorValue)) { + return DeliveryRuleHttpVersionCondition.fromJson(readerToUse.reset()); + } else if ("Cookies".equals(discriminatorValue)) { + return DeliveryRuleCookiesCondition.fromJson(readerToUse.reset()); + } else if ("IsDevice".equals(discriminatorValue)) { + return DeliveryRuleIsDeviceCondition.fromJson(readerToUse.reset()); + } else if ("SocketAddr".equals(discriminatorValue)) { + return DeliveryRuleSocketAddrCondition.fromJson(readerToUse.reset()); + } else if ("ClientPort".equals(discriminatorValue)) { + return DeliveryRuleClientPortCondition.fromJson(readerToUse.reset()); + } else if ("ServerPort".equals(discriminatorValue)) { + return DeliveryRuleServerPortCondition.fromJson(readerToUse.reset()); + } else if ("HostName".equals(discriminatorValue)) { + return DeliveryRuleHostnameCondition.fromJson(readerToUse.reset()); + } else if ("SslProtocol".equals(discriminatorValue)) { + return DeliveryRuleSslProtocolCondition.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DeliveryRuleCondition fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleCondition deserializedDeliveryRuleCondition = new DeliveryRuleCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDeliveryRuleCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleCondition; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleConditionParameters.java new file mode 100644 index 000000000000..0300a00427f9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleConditionParameters.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for delivery rule match conditions. + */ +@Immutable +public class DeliveryRuleConditionParameters implements JsonSerializable { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.fromString("DeliveryRuleConditionParameters"); + + /** + * Creates an instance of DeliveryRuleConditionParameters class. + */ + public DeliveryRuleConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeliveryRuleConditionParameters. + */ + public static DeliveryRuleConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("typeName".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("DeliveryRuleRemoteAddressConditionParameters".equals(discriminatorValue)) { + return RemoteAddressMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleRequestMethodConditionParameters".equals(discriminatorValue)) { + return RequestMethodMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleQueryStringConditionParameters".equals(discriminatorValue)) { + return QueryStringMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRulePostArgsConditionParameters".equals(discriminatorValue)) { + return PostArgsMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleRequestUriConditionParameters".equals(discriminatorValue)) { + return RequestUriMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleRequestHeaderConditionParameters".equals(discriminatorValue)) { + return RequestHeaderMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleRequestBodyConditionParameters".equals(discriminatorValue)) { + return RequestBodyMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleRequestSchemeConditionParameters".equals(discriminatorValue)) { + return RequestSchemeMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleUrlPathMatchConditionParameters".equals(discriminatorValue)) { + return UrlPathMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleUrlFileExtensionMatchConditionParameters".equals(discriminatorValue)) { + return UrlFileExtensionMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleUrlFilenameConditionParameters".equals(discriminatorValue)) { + return UrlFileNameMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleHttpVersionConditionParameters".equals(discriminatorValue)) { + return HttpVersionMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleCookiesConditionParameters".equals(discriminatorValue)) { + return CookiesMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleIsDeviceConditionParameters".equals(discriminatorValue)) { + return IsDeviceMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleSocketAddrConditionParameters".equals(discriminatorValue)) { + return SocketAddrMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleClientPortConditionParameters".equals(discriminatorValue)) { + return ClientPortMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleServerPortConditionParameters".equals(discriminatorValue)) { + return ServerPortMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleHostNameConditionParameters".equals(discriminatorValue)) { + return HostnameMatchConditionParameters.fromJson(readerToUse.reset()); + } else if ("DeliveryRuleSslProtocolConditionParameters".equals(discriminatorValue)) { + return SslProtocolMatchConditionParameters.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DeliveryRuleConditionParameters fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleConditionParameters deserializedDeliveryRuleConditionParameters + = new DeliveryRuleConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("typeName".equals(fieldName)) { + deserializedDeliveryRuleConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleConditionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleConditionParametersType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleConditionParametersType.java new file mode 100644 index 000000000000..b841b4a047ff --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleConditionParametersType.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for DeliveryRuleConditionParametersType. + */ +public final class DeliveryRuleConditionParametersType + extends ExpandableStringEnum { + /** + * Static value DeliveryRuleRemoteAddressConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_REMOTE_ADDRESS_CONDITION_PARAMETERS + = fromString("DeliveryRuleRemoteAddressConditionParameters"); + + /** + * Static value DeliveryRuleRequestMethodConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_REQUEST_METHOD_CONDITION_PARAMETERS + = fromString("DeliveryRuleRequestMethodConditionParameters"); + + /** + * Static value DeliveryRuleQueryStringConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_QUERY_STRING_CONDITION_PARAMETERS + = fromString("DeliveryRuleQueryStringConditionParameters"); + + /** + * Static value DeliveryRulePostArgsConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_POST_ARGS_CONDITION_PARAMETERS + = fromString("DeliveryRulePostArgsConditionParameters"); + + /** + * Static value DeliveryRuleRequestUriConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_REQUEST_URI_CONDITION_PARAMETERS + = fromString("DeliveryRuleRequestUriConditionParameters"); + + /** + * Static value DeliveryRuleRequestHeaderConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_REQUEST_HEADER_CONDITION_PARAMETERS + = fromString("DeliveryRuleRequestHeaderConditionParameters"); + + /** + * Static value DeliveryRuleRequestBodyConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_REQUEST_BODY_CONDITION_PARAMETERS + = fromString("DeliveryRuleRequestBodyConditionParameters"); + + /** + * Static value DeliveryRuleRequestSchemeConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_REQUEST_SCHEME_CONDITION_PARAMETERS + = fromString("DeliveryRuleRequestSchemeConditionParameters"); + + /** + * Static value DeliveryRuleUrlPathMatchConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_URL_PATH_MATCH_CONDITION_PARAMETERS + = fromString("DeliveryRuleUrlPathMatchConditionParameters"); + + /** + * Static value DeliveryRuleUrlFileExtensionMatchConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_URL_FILE_EXTENSION_MATCH_CONDITION_PARAMETERS + = fromString("DeliveryRuleUrlFileExtensionMatchConditionParameters"); + + /** + * Static value DeliveryRuleUrlFilenameConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_URL_FILENAME_CONDITION_PARAMETERS + = fromString("DeliveryRuleUrlFilenameConditionParameters"); + + /** + * Static value DeliveryRuleHttpVersionConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_HTTP_VERSION_CONDITION_PARAMETERS + = fromString("DeliveryRuleHttpVersionConditionParameters"); + + /** + * Static value DeliveryRuleCookiesConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_COOKIES_CONDITION_PARAMETERS + = fromString("DeliveryRuleCookiesConditionParameters"); + + /** + * Static value DeliveryRuleIsDeviceConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_IS_DEVICE_CONDITION_PARAMETERS + = fromString("DeliveryRuleIsDeviceConditionParameters"); + + /** + * Static value DeliveryRuleSocketAddrConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_SOCKET_ADDR_CONDITION_PARAMETERS + = fromString("DeliveryRuleSocketAddrConditionParameters"); + + /** + * Static value DeliveryRuleClientPortConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_CLIENT_PORT_CONDITION_PARAMETERS + = fromString("DeliveryRuleClientPortConditionParameters"); + + /** + * Static value DeliveryRuleServerPortConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_SERVER_PORT_CONDITION_PARAMETERS + = fromString("DeliveryRuleServerPortConditionParameters"); + + /** + * Static value DeliveryRuleHostNameConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_HOST_NAME_CONDITION_PARAMETERS + = fromString("DeliveryRuleHostNameConditionParameters"); + + /** + * Static value DeliveryRuleSslProtocolConditionParameters for DeliveryRuleConditionParametersType. + */ + public static final DeliveryRuleConditionParametersType DELIVERY_RULE_SSL_PROTOCOL_CONDITION_PARAMETERS + = fromString("DeliveryRuleSslProtocolConditionParameters"); + + /** + * Creates a new instance of DeliveryRuleConditionParametersType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeliveryRuleConditionParametersType() { + } + + /** + * Creates or finds a DeliveryRuleConditionParametersType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeliveryRuleConditionParametersType. + */ + public static DeliveryRuleConditionParametersType fromString(String name) { + return fromString(name, DeliveryRuleConditionParametersType.class); + } + + /** + * Gets known DeliveryRuleConditionParametersType values. + * + * @return known DeliveryRuleConditionParametersType values. + */ + public static Collection values() { + return values(DeliveryRuleConditionParametersType.class); + } +} 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 000000000000..949872059a7f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCookiesCondition.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the Cookies condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleCookiesCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.COOKIES; + + /* + * Defines the parameters for the condition. + */ + private CookiesMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleCookiesCondition class. + */ + public DeliveryRuleCookiesCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleCookiesCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleCookiesCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleCookiesCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleCookiesCondition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleCookiesCondition. + */ + public static DeliveryRuleCookiesCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleCookiesCondition deserializedDeliveryRuleCookiesCondition = new DeliveryRuleCookiesCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleCookiesCondition.parameters + = CookiesMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleCookiesCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleCookiesCondition; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHostnameCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHostnameCondition.java new file mode 100644 index 000000000000..72115ab52675 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHostnameCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the HostName condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleHostnameCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.HOST_NAME; + + /* + * Defines the parameters for the condition. + */ + private HostnameMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleHostnameCondition class. + */ + public DeliveryRuleHostnameCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public HostnameMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleHostnameCondition object itself. + */ + public DeliveryRuleHostnameCondition withParameters(HostnameMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleHostnameCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleHostnameCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleHostnameCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleHostnameCondition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleHostnameCondition. + */ + public static DeliveryRuleHostnameCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleHostnameCondition deserializedDeliveryRuleHostnameCondition + = new DeliveryRuleHostnameCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleHostnameCondition.parameters + = HostnameMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleHostnameCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleHostnameCondition; + }); + } +} 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 000000000000..70caa9795107 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHttpVersionCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the HttpVersion condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleHttpVersionCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.HTTP_VERSION; + + /* + * Defines the parameters for the condition. + */ + private HttpVersionMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleHttpVersionCondition class. + */ + public DeliveryRuleHttpVersionCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleHttpVersionCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleHttpVersionCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleHttpVersionCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleHttpVersionCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleHttpVersionCondition. + */ + public static DeliveryRuleHttpVersionCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleHttpVersionCondition deserializedDeliveryRuleHttpVersionCondition + = new DeliveryRuleHttpVersionCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleHttpVersionCondition.parameters + = HttpVersionMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleHttpVersionCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleHttpVersionCondition; + }); + } +} 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 000000000000..bf2728af6c6b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleIsDeviceCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the IsDevice condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleIsDeviceCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.IS_DEVICE; + + /* + * Defines the parameters for the condition. + */ + private IsDeviceMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleIsDeviceCondition class. + */ + public DeliveryRuleIsDeviceCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleIsDeviceCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleIsDeviceCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleIsDeviceCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleIsDeviceCondition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleIsDeviceCondition. + */ + public static DeliveryRuleIsDeviceCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleIsDeviceCondition deserializedDeliveryRuleIsDeviceCondition + = new DeliveryRuleIsDeviceCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleIsDeviceCondition.parameters + = IsDeviceMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleIsDeviceCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleIsDeviceCondition; + }); + } +} 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 000000000000..fb8ca2f623bd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRulePostArgsCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the PostArgs condition for the delivery rule. + */ +@Fluent +public final class DeliveryRulePostArgsCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.POST_ARGS; + + /* + * Defines the parameters for the condition. + */ + private PostArgsMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRulePostArgsCondition class. + */ + public DeliveryRulePostArgsCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRulePostArgsCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRulePostArgsCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRulePostArgsCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRulePostArgsCondition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRulePostArgsCondition. + */ + public static DeliveryRulePostArgsCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRulePostArgsCondition deserializedDeliveryRulePostArgsCondition + = new DeliveryRulePostArgsCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRulePostArgsCondition.parameters + = PostArgsMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRulePostArgsCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRulePostArgsCondition; + }); + } +} 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 000000000000..4d1a510161d9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleQueryStringCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the QueryString condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleQueryStringCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.QUERY_STRING; + + /* + * Defines the parameters for the condition. + */ + private QueryStringMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleQueryStringCondition class. + */ + public DeliveryRuleQueryStringCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleQueryStringCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleQueryStringCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleQueryStringCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleQueryStringCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleQueryStringCondition. + */ + public static DeliveryRuleQueryStringCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleQueryStringCondition deserializedDeliveryRuleQueryStringCondition + = new DeliveryRuleQueryStringCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleQueryStringCondition.parameters + = QueryStringMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleQueryStringCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleQueryStringCondition; + }); + } +} 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 000000000000..aeecb9d56e12 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRemoteAddressCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the RemoteAddress condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleRemoteAddressCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.REMOTE_ADDRESS; + + /* + * Defines the parameters for the condition. + */ + private RemoteAddressMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleRemoteAddressCondition class. + */ + public DeliveryRuleRemoteAddressCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRemoteAddressCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRemoteAddressCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleRemoteAddressCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleRemoteAddressCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleRemoteAddressCondition. + */ + public static DeliveryRuleRemoteAddressCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleRemoteAddressCondition deserializedDeliveryRuleRemoteAddressCondition + = new DeliveryRuleRemoteAddressCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleRemoteAddressCondition.parameters + = RemoteAddressMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleRemoteAddressCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleRemoteAddressCondition; + }); + } +} 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 000000000000..46cbd8f62d50 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestBodyCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the RequestBody condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleRequestBodyCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.REQUEST_BODY; + + /* + * Defines the parameters for the condition. + */ + private RequestBodyMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleRequestBodyCondition class. + */ + public DeliveryRuleRequestBodyCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestBodyCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestBodyCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleRequestBodyCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleRequestBodyCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleRequestBodyCondition. + */ + public static DeliveryRuleRequestBodyCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleRequestBodyCondition deserializedDeliveryRuleRequestBodyCondition + = new DeliveryRuleRequestBodyCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleRequestBodyCondition.parameters + = RequestBodyMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleRequestBodyCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleRequestBodyCondition; + }); + } +} 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 000000000000..fe141c0ebefe --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderAction.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the request header action for the delivery rule. + */ +@Fluent +public final class DeliveryRuleRequestHeaderAction extends DeliveryRuleAction { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.MODIFY_REQUEST_HEADER; + + /* + * Defines the parameters for the action. + */ + private HeaderActionParameters parameters; + + /** + * Creates an instance of DeliveryRuleRequestHeaderAction class. + */ + public DeliveryRuleRequestHeaderAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + @Override + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestHeaderAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestHeaderAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleRequestHeaderAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleRequestHeaderAction if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleRequestHeaderAction. + */ + public static DeliveryRuleRequestHeaderAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleRequestHeaderAction deserializedDeliveryRuleRequestHeaderAction + = new DeliveryRuleRequestHeaderAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleRequestHeaderAction.parameters = HeaderActionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleRequestHeaderAction.name + = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleRequestHeaderAction; + }); + } +} 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 000000000000..378ef9dfbc2f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the RequestHeader condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleRequestHeaderCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.REQUEST_HEADER; + + /* + * Defines the parameters for the condition. + */ + private RequestHeaderMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleRequestHeaderCondition class. + */ + public DeliveryRuleRequestHeaderCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestHeaderCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestHeaderCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleRequestHeaderCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleRequestHeaderCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleRequestHeaderCondition. + */ + public static DeliveryRuleRequestHeaderCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleRequestHeaderCondition deserializedDeliveryRuleRequestHeaderCondition + = new DeliveryRuleRequestHeaderCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleRequestHeaderCondition.parameters + = RequestHeaderMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleRequestHeaderCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleRequestHeaderCondition; + }); + } +} 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 000000000000..471796a32c1d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestMethodCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the RequestMethod condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleRequestMethodCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.REQUEST_METHOD; + + /* + * Defines the parameters for the condition. + */ + private RequestMethodMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleRequestMethodCondition class. + */ + public DeliveryRuleRequestMethodCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestMethodCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestMethodCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleRequestMethodCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleRequestMethodCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleRequestMethodCondition. + */ + public static DeliveryRuleRequestMethodCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleRequestMethodCondition deserializedDeliveryRuleRequestMethodCondition + = new DeliveryRuleRequestMethodCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleRequestMethodCondition.parameters + = RequestMethodMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleRequestMethodCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleRequestMethodCondition; + }); + } +} 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 000000000000..bc170323a12f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestSchemeCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the RequestScheme condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleRequestSchemeCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.REQUEST_SCHEME; + + /* + * Defines the parameters for the condition. + */ + private RequestSchemeMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleRequestSchemeCondition class. + */ + public DeliveryRuleRequestSchemeCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestSchemeCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestSchemeCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleRequestSchemeCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleRequestSchemeCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleRequestSchemeCondition. + */ + public static DeliveryRuleRequestSchemeCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleRequestSchemeCondition deserializedDeliveryRuleRequestSchemeCondition + = new DeliveryRuleRequestSchemeCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleRequestSchemeCondition.parameters + = RequestSchemeMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleRequestSchemeCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleRequestSchemeCondition; + }); + } +} 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 000000000000..e590626aa3ab --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestUriCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the RequestUri condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleRequestUriCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.REQUEST_URI; + + /* + * Defines the parameters for the condition. + */ + private RequestUriMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleRequestUriCondition class. + */ + public DeliveryRuleRequestUriCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestUriCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestUriCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleRequestUriCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleRequestUriCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleRequestUriCondition. + */ + public static DeliveryRuleRequestUriCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleRequestUriCondition deserializedDeliveryRuleRequestUriCondition + = new DeliveryRuleRequestUriCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleRequestUriCondition.parameters + = RequestUriMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleRequestUriCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleRequestUriCondition; + }); + } +} 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 000000000000..2012c61cd372 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleResponseHeaderAction.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the response header action for the delivery rule. + */ +@Fluent +public final class DeliveryRuleResponseHeaderAction extends DeliveryRuleAction { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.MODIFY_RESPONSE_HEADER; + + /* + * Defines the parameters for the action. + */ + private HeaderActionParameters parameters; + + /** + * Creates an instance of DeliveryRuleResponseHeaderAction class. + */ + public DeliveryRuleResponseHeaderAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + @Override + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleResponseHeaderAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleResponseHeaderAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleResponseHeaderAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleResponseHeaderAction if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleResponseHeaderAction. + */ + public static DeliveryRuleResponseHeaderAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleResponseHeaderAction deserializedDeliveryRuleResponseHeaderAction + = new DeliveryRuleResponseHeaderAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleResponseHeaderAction.parameters = HeaderActionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleResponseHeaderAction.name + = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleResponseHeaderAction; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRouteConfigurationOverrideAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRouteConfigurationOverrideAction.java new file mode 100644 index 000000000000..f064ff6ed7a8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRouteConfigurationOverrideAction.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the route configuration override action for the delivery rule. Only applicable to Frontdoor Standard/Premium + * Profiles. + */ +@Fluent +public final class DeliveryRuleRouteConfigurationOverrideAction extends DeliveryRuleAction { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.ROUTE_CONFIGURATION_OVERRIDE; + + /* + * Defines the parameters for the action. + */ + private RouteConfigurationOverrideActionParameters parameters; + + /** + * Creates an instance of DeliveryRuleRouteConfigurationOverrideAction class. + */ + public DeliveryRuleRouteConfigurationOverrideAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + @Override + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public RouteConfigurationOverrideActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleRouteConfigurationOverrideAction object itself. + */ + public DeliveryRuleRouteConfigurationOverrideAction + withParameters(RouteConfigurationOverrideActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRouteConfigurationOverrideAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRouteConfigurationOverrideAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleRouteConfigurationOverrideAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleRouteConfigurationOverrideAction if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleRouteConfigurationOverrideAction. + */ + public static DeliveryRuleRouteConfigurationOverrideAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleRouteConfigurationOverrideAction deserializedDeliveryRuleRouteConfigurationOverrideAction + = new DeliveryRuleRouteConfigurationOverrideAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleRouteConfigurationOverrideAction.parameters + = RouteConfigurationOverrideActionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleRouteConfigurationOverrideAction.name + = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleRouteConfigurationOverrideAction; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleServerPortCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleServerPortCondition.java new file mode 100644 index 000000000000..83558754918f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleServerPortCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the ServerPort condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleServerPortCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.SERVER_PORT; + + /* + * Defines the parameters for the condition. + */ + private ServerPortMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleServerPortCondition class. + */ + public DeliveryRuleServerPortCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public ServerPortMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleServerPortCondition object itself. + */ + public DeliveryRuleServerPortCondition withParameters(ServerPortMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleServerPortCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleServerPortCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleServerPortCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleServerPortCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleServerPortCondition. + */ + public static DeliveryRuleServerPortCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleServerPortCondition deserializedDeliveryRuleServerPortCondition + = new DeliveryRuleServerPortCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleServerPortCondition.parameters + = ServerPortMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleServerPortCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleServerPortCondition; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSocketAddrCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSocketAddrCondition.java new file mode 100644 index 000000000000..0bada9648d63 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSocketAddrCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the SocketAddress condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleSocketAddrCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.SOCKET_ADDR; + + /* + * Defines the parameters for the condition. + */ + private SocketAddrMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleSocketAddrCondition class. + */ + public DeliveryRuleSocketAddrCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public SocketAddrMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleSocketAddrCondition object itself. + */ + public DeliveryRuleSocketAddrCondition withParameters(SocketAddrMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleSocketAddrCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleSocketAddrCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleSocketAddrCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleSocketAddrCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleSocketAddrCondition. + */ + public static DeliveryRuleSocketAddrCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleSocketAddrCondition deserializedDeliveryRuleSocketAddrCondition + = new DeliveryRuleSocketAddrCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleSocketAddrCondition.parameters + = SocketAddrMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleSocketAddrCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleSocketAddrCondition; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSslProtocolCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSslProtocolCondition.java new file mode 100644 index 000000000000..bd7e8ddb5d22 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSslProtocolCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the SslProtocol condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleSslProtocolCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.SSL_PROTOCOL; + + /* + * Defines the parameters for the condition. + */ + private SslProtocolMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleSslProtocolCondition class. + */ + public DeliveryRuleSslProtocolCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public SslProtocolMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleSslProtocolCondition object itself. + */ + public DeliveryRuleSslProtocolCondition withParameters(SslProtocolMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleSslProtocolCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleSslProtocolCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleSslProtocolCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleSslProtocolCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleSslProtocolCondition. + */ + public static DeliveryRuleSslProtocolCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleSslProtocolCondition deserializedDeliveryRuleSslProtocolCondition + = new DeliveryRuleSslProtocolCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleSslProtocolCondition.parameters + = SslProtocolMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleSslProtocolCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleSslProtocolCondition; + }); + } +} 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 000000000000..d5be633ca61d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileExtensionCondition.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the UrlFileExtension condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleUrlFileExtensionCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.URL_FILE_EXTENSION; + + /* + * Defines the parameters for the condition. + */ + private UrlFileExtensionMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleUrlFileExtensionCondition class. + */ + public DeliveryRuleUrlFileExtensionCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleUrlFileExtensionCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleUrlFileExtensionCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleUrlFileExtensionCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleUrlFileExtensionCondition if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleUrlFileExtensionCondition. + */ + public static DeliveryRuleUrlFileExtensionCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleUrlFileExtensionCondition deserializedDeliveryRuleUrlFileExtensionCondition + = new DeliveryRuleUrlFileExtensionCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleUrlFileExtensionCondition.parameters + = UrlFileExtensionMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleUrlFileExtensionCondition.name + = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleUrlFileExtensionCondition; + }); + } +} 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 000000000000..d7958cdc0471 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileNameCondition.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the UrlFileName condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleUrlFileNameCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.URL_FILE_NAME; + + /* + * Defines the parameters for the condition. + */ + private UrlFileNameMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleUrlFileNameCondition class. + */ + public DeliveryRuleUrlFileNameCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleUrlFileNameCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleUrlFileNameCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleUrlFileNameCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleUrlFileNameCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleUrlFileNameCondition. + */ + public static DeliveryRuleUrlFileNameCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleUrlFileNameCondition deserializedDeliveryRuleUrlFileNameCondition + = new DeliveryRuleUrlFileNameCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleUrlFileNameCondition.parameters + = UrlFileNameMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleUrlFileNameCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleUrlFileNameCondition; + }); + } +} 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 000000000000..10d6ff7d93a8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlPathCondition.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the UrlPath condition for the delivery rule. + */ +@Fluent +public final class DeliveryRuleUrlPathCondition extends DeliveryRuleCondition { + /* + * The name of the condition for the delivery rule. + */ + private MatchVariable name = MatchVariable.URL_PATH; + + /* + * Defines the parameters for the condition. + */ + private UrlPathMatchConditionParameters parameters; + + /** + * Creates an instance of DeliveryRuleUrlPathCondition class. + */ + public DeliveryRuleUrlPathCondition() { + } + + /** + * Get the name property: The name of the condition for the delivery rule. + * + * @return the name value. + */ + @Override + public MatchVariable name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleUrlPathCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleUrlPathCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeliveryRuleUrlPathCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeliveryRuleUrlPathCondition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeliveryRuleUrlPathCondition. + */ + public static DeliveryRuleUrlPathCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeliveryRuleUrlPathCondition deserializedDeliveryRuleUrlPathCondition = new DeliveryRuleUrlPathCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDeliveryRuleUrlPathCondition.parameters + = UrlPathMatchConditionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDeliveryRuleUrlPathCondition.name = MatchVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeliveryRuleUrlPathCondition; + }); + } +} 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 000000000000..e98759408fc3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeploymentStatus.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 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 a new instance of DeploymentStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentStatus() { + } + + /** + * Creates or finds a DeploymentStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentStatus. + */ + public static DeploymentStatus fromString(String name) { + return fromString(name, DeploymentStatus.class); + } + + /** + * Gets known DeploymentStatus values. + * + * @return known DeploymentStatus values. + */ + public static Collection values() { + return values(DeploymentStatus.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DestinationProtocol.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DestinationProtocol.java new file mode 100644 index 000000000000..08cef6314101 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DestinationProtocol.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Protocol to use for the redirect. The default value is MatchRequest. + */ +public final class DestinationProtocol extends ExpandableStringEnum { + /** + * Static value MatchRequest for DestinationProtocol. + */ + public static final DestinationProtocol MATCH_REQUEST = fromString("MatchRequest"); + + /** + * Static value Http for DestinationProtocol. + */ + public static final DestinationProtocol HTTP = fromString("Http"); + + /** + * Static value Https for DestinationProtocol. + */ + public static final DestinationProtocol HTTPS = fromString("Https"); + + /** + * Creates a new instance of DestinationProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DestinationProtocol() { + } + + /** + * Creates or finds a DestinationProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding DestinationProtocol. + */ + public static DestinationProtocol fromString(String name) { + return fromString(name, DestinationProtocol.class); + } + + /** + * Gets known DestinationProtocol values. + * + * @return known DestinationProtocol values. + */ + public static Collection values() { + return values(DestinationProtocol.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DimensionProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DimensionProperties.java new file mode 100644 index 000000000000..d95ccbb152c0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DimensionProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Type of operation: get, read, delete, etc. + */ +@Fluent +public final class DimensionProperties implements JsonSerializable { + /* + * Name of dimension. + */ + private String name; + + /* + * Display name of dimension. + */ + private String displayName; + + /* + * Internal name of dimension. + */ + private String internalName; + + /** + * Creates an instance of DimensionProperties class. + */ + public DimensionProperties() { + } + + /** + * Get the name property: Name of dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of dimension. + * + * @param name the name value to set. + * @return the DimensionProperties object itself. + */ + public DimensionProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of dimension. + * + * @param displayName the displayName value to set. + * @return the DimensionProperties object itself. + */ + public DimensionProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internalName property: Internal name of dimension. + * + * @return the internalName value. + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internalName property: Internal name of dimension. + * + * @param internalName the internalName value to set. + * @return the DimensionProperties object itself. + */ + public DimensionProperties withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("internalName", this.internalName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DimensionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DimensionProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DimensionProperties. + */ + public static DimensionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DimensionProperties deserializedDimensionProperties = new DimensionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDimensionProperties.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedDimensionProperties.displayName = reader.getString(); + } else if ("internalName".equals(fieldName)) { + deserializedDimensionProperties.internalName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDimensionProperties; + }); + } +} 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 000000000000..e8436878d0f0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The JSON object that contains the properties to validate a domain. + */ +@Immutable +public final class DomainValidationProperties implements JsonSerializable { + /* + * Challenge used for DNS TXT record or file based validation + */ + private String validationToken; + + /* + * The date time that the token expires + */ + private String expirationDate; + + /** + * Creates an instance of DomainValidationProperties class. + */ + public DomainValidationProperties() { + } + + /** + * Get the validationToken property: Challenge used for DNS TXT record or file based validation. + * + * @return the validationToken value. + */ + public String validationToken() { + return this.validationToken; + } + + /** + * Get the expirationDate property: The date time that the token expires. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DomainValidationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DomainValidationProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DomainValidationProperties. + */ + public static DomainValidationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DomainValidationProperties deserializedDomainValidationProperties = new DomainValidationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("validationToken".equals(fieldName)) { + deserializedDomainValidationProperties.validationToken = reader.getString(); + } else if ("expirationDate".equals(fieldName)) { + deserializedDomainValidationProperties.expirationDate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDomainValidationProperties; + }); + } +} 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 000000000000..b14080dd9292 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. DCV stands for + * DomainControlValidation. + */ +public final class DomainValidationState extends ExpandableStringEnum { + /** + * Static value Unknown for DomainValidationState. + */ + public static final DomainValidationState UNKNOWN = fromString("Unknown"); + + /** + * Static value Submitting for DomainValidationState. + */ + public static final DomainValidationState SUBMITTING = fromString("Submitting"); + + /** + * Static value Pending for DomainValidationState. + */ + public static final DomainValidationState PENDING = fromString("Pending"); + + /** + * Static value Rejected for DomainValidationState. + */ + public static final DomainValidationState REJECTED = fromString("Rejected"); + + /** + * Static value TimedOut for DomainValidationState. + */ + public static final DomainValidationState TIMED_OUT = fromString("TimedOut"); + + /** + * Static value PendingRevalidation for DomainValidationState. + */ + public static final DomainValidationState PENDING_REVALIDATION = fromString("PendingRevalidation"); + + /** + * Static value Approved for DomainValidationState. + */ + public static final DomainValidationState APPROVED = fromString("Approved"); + + /** + * Static value RefreshingValidationToken for DomainValidationState. + */ + public static final DomainValidationState REFRESHING_VALIDATION_TOKEN = fromString("RefreshingValidationToken"); + + /** + * Static value InternalError for DomainValidationState. + */ + public static final DomainValidationState INTERNAL_ERROR = fromString("InternalError"); + + /** + * Creates a new instance of DomainValidationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DomainValidationState() { + } + + /** + * Creates or finds a DomainValidationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DomainValidationState. + */ + public static DomainValidationState fromString(String name) { + return fromString(name, DomainValidationState.class); + } + + /** + * Gets known DomainValidationState values. + * + * @return known DomainValidationState values. + */ + public static Collection values() { + return values(DomainValidationState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNode.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNode.java new file mode 100644 index 000000000000..43bd929f00dc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNode.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.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import java.util.List; + +/** + * An immutable client-side representation of EdgeNode. + */ +public interface EdgeNode { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the ipAddressGroups property: List of ip address groups. + * + * @return the ipAddressGroups value. + */ + List ipAddressGroups(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner object. + * + * @return the inner object. + */ + EdgeNodeInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNodes.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNodes.java new file mode 100644 index 000000000000..47ff067bdb2c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNodes.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of EdgeNodes. + */ +public interface EdgeNodes { + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgenodeResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgenodeResult.java new file mode 100644 index 000000000000..bdf18cb9ff7e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgenodeResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * Edge node of CDN service. + */ + private List value; + + /* + * URL to get the next set of edgenode list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of EdgenodeResult class. + */ + public EdgenodeResult() { + } + + /** + * Get the value property: Edge node of CDN service. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of edgenode list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of edgenode list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the EdgenodeResult object itself. + */ + public EdgenodeResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgenodeResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgenodeResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EdgenodeResult. + */ + public static EdgenodeResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgenodeResult deserializedEdgenodeResult = new EdgenodeResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EdgeNodeInner.fromJson(reader1)); + deserializedEdgenodeResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEdgenodeResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgenodeResult; + }); + } +} 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 000000000000..8a16ebf7beb5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EnabledState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + */ +public final class EnabledState extends ExpandableStringEnum { + /** + * Static value Enabled for EnabledState. + */ + public static final EnabledState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for EnabledState. + */ + public static final EnabledState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of EnabledState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnabledState() { + } + + /** + * Creates or finds a EnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnabledState. + */ + public static EnabledState fromString(String name) { + return fromString(name, EnabledState.class); + } + + /** + * Gets known EnabledState values. + * + * @return known EnabledState values. + */ + public static Collection values() { + return values(EnabledState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoint.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoint.java new file mode 100644 index 000000000000..1eb0e3ddf725 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoint.java @@ -0,0 +1,1014 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of Endpoint. + */ +public interface Endpoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the origins property: The source of the content being delivered via CDN. + * + * @return the origins value. + */ + List origins(); + + /** + * Gets the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @return the originGroups value. + */ + List originGroups(); + + /** + * Gets the customDomains property: The custom domains under the endpoint. + * + * @return the customDomains value. + */ + List customDomains(); + + /** + * Gets the resourceState property: Resource status of the endpoint. + * + * @return the resourceState value. + */ + EndpointResourceState resourceState(); + + /** + * Gets the provisioningState property: Provisioning status of the endpoint. + * + * @return the provisioningState value. + */ + EndpointProvisioningState provisioningState(); + + /** + * Gets the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + String originPath(); + + /** + * Gets the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + List contentTypesToCompress(); + + /** + * Gets the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + String originHostHeader(); + + /** + * Gets the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + Boolean isCompressionEnabled(); + + /** + * Gets the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value. + */ + Boolean isHttpAllowed(); + + /** + * Gets the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value. + */ + Boolean isHttpsAllowed(); + + /** + * Gets the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @return the queryStringCachingBehavior value. + */ + QueryStringCachingBehavior queryStringCachingBehavior(); + + /** + * Gets the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @return the optimizationType value. + */ + OptimizationType optimizationType(); + + /** + * Gets the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @return the probePath value. + */ + String probePath(); + + /** + * Gets the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value. + */ + List geoFilters(); + + /** + * Gets the defaultOriginGroup property: A reference to the origin group. + * + * @return the defaultOriginGroup value. + */ + ResourceReference defaultOriginGroup(); + + /** + * Gets the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @return the urlSigningKeys value. + */ + List urlSigningKeys(); + + /** + * Gets the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value. + */ + EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy(); + + /** + * Gets the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner object. + * + * @return the inner object. + */ + EndpointInner innerModel(); + + /** + * The entirety of the Endpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Endpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Endpoint definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Endpoint definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** + * The stage of the Endpoint definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + + /** + * The stage of the Endpoint definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithOrigins, + DefinitionStages.WithOriginGroups, DefinitionStages.WithOriginPath, + DefinitionStages.WithContentTypesToCompress, DefinitionStages.WithOriginHostHeader, + DefinitionStages.WithIsCompressionEnabled, DefinitionStages.WithIsHttpAllowed, + DefinitionStages.WithIsHttpsAllowed, DefinitionStages.WithQueryStringCachingBehavior, + DefinitionStages.WithOptimizationType, DefinitionStages.WithProbePath, DefinitionStages.WithGeoFilters, + DefinitionStages.WithDefaultOriginGroup, DefinitionStages.WithUrlSigningKeys, + DefinitionStages.WithDeliveryPolicy, DefinitionStages.WithWebApplicationFirewallPolicyLink { + /** + * Executes the create request. + * + * @return the created resource. + */ + Endpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Endpoint create(Context context); + } + + /** + * The stage of the Endpoint definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Endpoint definition allowing to specify origins. + */ + interface WithOrigins { + /** + * Specifies the origins property: The source of the content being delivered via CDN.. + * + * @param origins The source of the content being delivered via CDN. + * @return the next definition stage. + */ + WithCreate withOrigins(List origins); + } + + /** + * The stage of the Endpoint definition allowing to specify originGroups. + */ + interface WithOriginGroups { + /** + * Specifies the originGroups property: The origin groups comprising of origins that are used for load + * balancing the traffic based on availability.. + * + * @param originGroups The origin groups comprising of origins that are used for load balancing the traffic + * based on availability. + * @return the next definition stage. + */ + WithCreate withOriginGroups(List originGroups); + } + + /** + * The stage of the Endpoint definition allowing to specify originPath. + */ + interface WithOriginPath { + /** + * Specifies the originPath property: A directory path on the origin that CDN can use to retrieve content + * from, e.g. contoso.cloudapp.net/originpath.. + * + * @param originPath A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * @return the next definition stage. + */ + WithCreate withOriginPath(String originPath); + } + + /** + * The stage of the Endpoint definition allowing to specify contentTypesToCompress. + */ + interface WithContentTypesToCompress { + /** + * Specifies the contentTypesToCompress property: List of content types on which compression applies. The + * value should be a valid MIME type.. + * + * @param contentTypesToCompress List of content types on which compression applies. The value should be a + * valid MIME type. + * @return the next definition stage. + */ + WithCreate withContentTypesToCompress(List contentTypesToCompress); + } + + /** + * The stage of the Endpoint definition allowing to specify originHostHeader. + */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. This + * property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same + * property specified at origin.If you leave this blank, the request hostname determines this value. Azure + * CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match + * the origin hostname by default.. + * + * @param originHostHeader The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property + * specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN + * origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the + * origin hostname by default. + * @return the next definition stage. + */ + WithCreate withOriginHostHeader(String originHostHeader); + } + + /** + * The stage of the Endpoint definition allowing to specify isCompressionEnabled. + */ + interface WithIsCompressionEnabled { + /** + * Specifies the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. + * Default value is false. If compression is enabled, content will be served as compressed if user requests + * for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 + * byte or larger than 1 MB.. + * + * @param isCompressionEnabled Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed + * version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than + * 1 MB. + * @return the next definition stage. + */ + WithCreate withIsCompressionEnabled(Boolean isCompressionEnabled); + } + + /** + * The stage of the Endpoint definition allowing to specify isHttpAllowed. + */ + interface WithIsHttpAllowed { + /** + * Specifies the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default + * value is true. At least one protocol (HTTP or HTTPS) must be allowed.. + * + * @param isHttpAllowed Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At + * least one protocol (HTTP or HTTPS) must be allowed. + * @return the next definition stage. + */ + WithCreate withIsHttpAllowed(Boolean isHttpAllowed); + } + + /** + * The stage of the Endpoint definition allowing to specify isHttpsAllowed. + */ + interface WithIsHttpsAllowed { + /** + * Specifies the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. + * Default value is true. At least one protocol (HTTP or HTTPS) must be allowed.. + * + * @param isHttpsAllowed Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * @return the next definition stage. + */ + WithCreate withIsHttpsAllowed(Boolean isHttpsAllowed); + } + + /** + * The stage of the Endpoint definition allowing to specify queryStringCachingBehavior. + */ + interface WithQueryStringCachingBehavior { + /** + * Specifies the queryStringCachingBehavior property: Defines how CDN caches requests that include query + * strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain + * query strings from being cached, or cache every request with a unique URL.. + * + * @param queryStringCachingBehavior Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from + * being cached, or cache every request with a unique URL. + * @return the next definition stage. + */ + WithCreate withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior); + } + + /** + * The stage of the Endpoint definition allowing to specify optimizationType. + */ + interface WithOptimizationType { + /** + * Specifies the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to + * optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven + * optimization.. + * + * @param optimizationType Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * @return the next definition stage. + */ + WithCreate withOptimizationType(OptimizationType optimizationType); + } + + /** + * The stage of the Endpoint definition allowing to specify probePath. + */ + interface WithProbePath { + /** + * Specifies the probePath property: Path to a file hosted on the origin which helps accelerate delivery of + * the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin + * path. This property is only relevant when using a single origin.. + * + * @param probePath Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This + * property is only relevant when using a single origin. + * @return the next definition stage. + */ + WithCreate withProbePath(String probePath); + } + + /** + * The stage of the Endpoint definition allowing to specify geoFilters. + */ + interface WithGeoFilters { + /** + * Specifies the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. + * Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path + * /pictures/. + * + * @param geoFilters List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * @return the next definition stage. + */ + WithCreate withGeoFilters(List geoFilters); + } + + /** + * The stage of the Endpoint definition allowing to specify defaultOriginGroup. + */ + interface WithDefaultOriginGroup { + /** + * Specifies the defaultOriginGroup property: A reference to the origin group.. + * + * @param defaultOriginGroup A reference to the origin group. + * @return the next definition stage. + */ + WithCreate withDefaultOriginGroup(ResourceReference defaultOriginGroup); + } + + /** + * The stage of the Endpoint definition allowing to specify urlSigningKeys. + */ + interface WithUrlSigningKeys { + /** + * Specifies the urlSigningKeys property: List of keys used to validate the signed URL hashes.. + * + * @param urlSigningKeys List of keys used to validate the signed URL hashes. + * @return the next definition stage. + */ + WithCreate withUrlSigningKeys(List urlSigningKeys); + } + + /** + * The stage of the Endpoint definition allowing to specify deliveryPolicy. + */ + interface WithDeliveryPolicy { + /** + * Specifies the deliveryPolicy property: A policy that specifies the delivery rules to be used for an + * endpoint.. + * + * @param deliveryPolicy A policy that specifies the delivery rules to be used for an endpoint. + * @return the next definition stage. + */ + WithCreate withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy); + } + + /** + * The stage of the Endpoint definition allowing to specify webApplicationFirewallPolicyLink. + */ + interface WithWebApplicationFirewallPolicyLink { + /** + * Specifies the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for + * the endpoint (if applicable). + * + * @param webApplicationFirewallPolicyLink Defines the Web Application Firewall policy for the endpoint (if + * applicable). + * @return the next definition stage. + */ + WithCreate withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink); + } + } + + /** + * Begins update for the Endpoint resource. + * + * @return the stage of resource update. + */ + Endpoint.Update update(); + + /** + * The template for Endpoint update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithOriginPath, + UpdateStages.WithContentTypesToCompress, UpdateStages.WithOriginHostHeader, + UpdateStages.WithIsCompressionEnabled, UpdateStages.WithIsHttpAllowed, UpdateStages.WithIsHttpsAllowed, + UpdateStages.WithQueryStringCachingBehavior, UpdateStages.WithOptimizationType, UpdateStages.WithProbePath, + UpdateStages.WithGeoFilters, UpdateStages.WithDefaultOriginGroup, UpdateStages.WithUrlSigningKeys, + UpdateStages.WithDeliveryPolicy, UpdateStages.WithWebApplicationFirewallPolicyLink { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Endpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Endpoint apply(Context context); + } + + /** + * The Endpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the Endpoint update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Endpoint tags.. + * + * @param tags Endpoint tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Endpoint update allowing to specify originPath. + */ + interface WithOriginPath { + /** + * Specifies the originPath property: A directory path on the origin that CDN can use to retrieve content + * from, e.g. contoso.cloudapp.net/originpath.. + * + * @param originPath A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * @return the next definition stage. + */ + Update withOriginPath(String originPath); + } + + /** + * The stage of the Endpoint update allowing to specify contentTypesToCompress. + */ + interface WithContentTypesToCompress { + /** + * Specifies the contentTypesToCompress property: List of content types on which compression applies. The + * value should be a valid MIME type.. + * + * @param contentTypesToCompress List of content types on which compression applies. The value should be a + * valid MIME type. + * @return the next definition stage. + */ + Update withContentTypesToCompress(List contentTypesToCompress); + } + + /** + * The stage of the Endpoint update allowing to specify originHostHeader. + */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. This + * property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same + * property specified at origin.If you leave this blank, the request hostname determines this value. Azure + * CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match + * the origin hostname by default.. + * + * @param originHostHeader The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property + * specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN + * origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the + * origin hostname by default. + * @return the next definition stage. + */ + Update withOriginHostHeader(String originHostHeader); + } + + /** + * The stage of the Endpoint update allowing to specify isCompressionEnabled. + */ + interface WithIsCompressionEnabled { + /** + * Specifies the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. + * Default value is false. If compression is enabled, content will be served as compressed if user requests + * for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 + * byte or larger than 1 MB.. + * + * @param isCompressionEnabled Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed + * version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than + * 1 MB. + * @return the next definition stage. + */ + Update withIsCompressionEnabled(Boolean isCompressionEnabled); + } + + /** + * The stage of the Endpoint update allowing to specify isHttpAllowed. + */ + interface WithIsHttpAllowed { + /** + * Specifies the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default + * value is true. At least one protocol (HTTP or HTTPS) must be allowed.. + * + * @param isHttpAllowed Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At + * least one protocol (HTTP or HTTPS) must be allowed. + * @return the next definition stage. + */ + Update withIsHttpAllowed(Boolean isHttpAllowed); + } + + /** + * The stage of the Endpoint update allowing to specify isHttpsAllowed. + */ + interface WithIsHttpsAllowed { + /** + * Specifies the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. + * Default value is true. At least one protocol (HTTP or HTTPS) must be allowed.. + * + * @param isHttpsAllowed Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * @return the next definition stage. + */ + Update withIsHttpsAllowed(Boolean isHttpsAllowed); + } + + /** + * The stage of the Endpoint update allowing to specify queryStringCachingBehavior. + */ + interface WithQueryStringCachingBehavior { + /** + * Specifies the queryStringCachingBehavior property: Defines how CDN caches requests that include query + * strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain + * query strings from being cached, or cache every request with a unique URL.. + * + * @param queryStringCachingBehavior Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from + * being cached, or cache every request with a unique URL. + * @return the next definition stage. + */ + Update withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior); + } + + /** + * The stage of the Endpoint update allowing to specify optimizationType. + */ + interface WithOptimizationType { + /** + * Specifies the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to + * optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven + * optimization.. + * + * @param optimizationType Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * @return the next definition stage. + */ + Update withOptimizationType(OptimizationType optimizationType); + } + + /** + * The stage of the Endpoint update allowing to specify probePath. + */ + interface WithProbePath { + /** + * Specifies the probePath property: Path to a file hosted on the origin which helps accelerate delivery of + * the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin + * path. This property is only relevant when using a single origin.. + * + * @param probePath Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This + * property is only relevant when using a single origin. + * @return the next definition stage. + */ + Update withProbePath(String probePath); + } + + /** + * The stage of the Endpoint update allowing to specify geoFilters. + */ + interface WithGeoFilters { + /** + * Specifies the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. + * Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path + * /pictures/. + * + * @param geoFilters List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * @return the next definition stage. + */ + Update withGeoFilters(List geoFilters); + } + + /** + * The stage of the Endpoint update allowing to specify defaultOriginGroup. + */ + interface WithDefaultOriginGroup { + /** + * Specifies the defaultOriginGroup property: A reference to the origin group.. + * + * @param defaultOriginGroup A reference to the origin group. + * @return the next definition stage. + */ + Update withDefaultOriginGroup(ResourceReference defaultOriginGroup); + } + + /** + * The stage of the Endpoint update allowing to specify urlSigningKeys. + */ + interface WithUrlSigningKeys { + /** + * Specifies the urlSigningKeys property: List of keys used to validate the signed URL hashes.. + * + * @param urlSigningKeys List of keys used to validate the signed URL hashes. + * @return the next definition stage. + */ + Update withUrlSigningKeys(List urlSigningKeys); + } + + /** + * The stage of the Endpoint update allowing to specify deliveryPolicy. + */ + interface WithDeliveryPolicy { + /** + * Specifies the deliveryPolicy property: A policy that specifies the delivery rules to be used for an + * endpoint.. + * + * @param deliveryPolicy A policy that specifies the delivery rules to be used for an endpoint. + * @return the next definition stage. + */ + Update withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy); + } + + /** + * The stage of the Endpoint update allowing to specify webApplicationFirewallPolicyLink. + */ + interface WithWebApplicationFirewallPolicyLink { + /** + * Specifies the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for + * the endpoint (if applicable). + * + * @param webApplicationFirewallPolicyLink Defines the Web Application Firewall policy for the endpoint (if + * applicable). + * @return the next definition stage. + */ + Update withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Endpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Endpoint refresh(Context context); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint start(); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint start(Context context); + + /** + * Stops an existing running CDN endpoint. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint stop(); + + /** + * Stops an existing running CDN endpoint. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint stop(Context context); + + /** + * Removes a content from CDN. + * + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeContent(PurgeParameters contentFilePaths); + + /** + * Removes a content from CDN. + * + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeContent(PurgeParameters contentFilePaths, Context context); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void loadContent(LoadParameters contentFilePaths); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void loadContent(LoadParameters contentFilePaths, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + Response + validateCustomDomainWithResponse(ValidateCustomDomainInput customDomainProperties, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointListResult.java new file mode 100644 index 000000000000..036d234d4026 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of CDN endpoints within a profile + */ + private List value; + + /* + * URL to get the next set of endpoint objects if there is any. + */ + private String nextLink; + + /** + * Creates an instance of EndpointListResult class. + */ + public EndpointListResult() { + } + + /** + * Get the value property: List of CDN endpoints within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of endpoint objects if there is any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of endpoint objects if there is any. + * + * @param nextLink the nextLink value to set. + * @return the EndpointListResult object itself. + */ + public EndpointListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointListResult. + */ + public static EndpointListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointListResult deserializedEndpointListResult = new EndpointListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EndpointInner.fromJson(reader1)); + deserializedEndpointListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEndpointListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointListResult; + }); + } +} 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 000000000000..6fbadf33dd66 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersDeliveryPolicy.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A policy that specifies the delivery rules to be used for an endpoint. + */ +@Fluent +public final class EndpointPropertiesUpdateParametersDeliveryPolicy + implements JsonSerializable { + /* + * User-friendly description of the policy. + */ + private String description; + + /* + * A list of the delivery rules. + */ + private List rules; + + /** + * Creates an instance of EndpointPropertiesUpdateParametersDeliveryPolicy class. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy() { + } + + /** + * Get the description property: User-friendly description of the policy. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User-friendly description of the policy. + * + * @param description the description value to set. + * @return the EndpointPropertiesUpdateParametersDeliveryPolicy object itself. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rules property: A list of the delivery rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: A list of the delivery rules. + * + * @param rules the rules value to set. + * @return the EndpointPropertiesUpdateParametersDeliveryPolicy object itself. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property rules in model EndpointPropertiesUpdateParametersDeliveryPolicy")); + } else { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EndpointPropertiesUpdateParametersDeliveryPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointPropertiesUpdateParametersDeliveryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointPropertiesUpdateParametersDeliveryPolicy if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EndpointPropertiesUpdateParametersDeliveryPolicy. + */ + public static EndpointPropertiesUpdateParametersDeliveryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointPropertiesUpdateParametersDeliveryPolicy deserializedEndpointPropertiesUpdateParametersDeliveryPolicy + = new EndpointPropertiesUpdateParametersDeliveryPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> DeliveryRule.fromJson(reader1)); + deserializedEndpointPropertiesUpdateParametersDeliveryPolicy.rules = rules; + } else if ("description".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParametersDeliveryPolicy.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointPropertiesUpdateParametersDeliveryPolicy; + }); + } +} 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 000000000000..e2998478c436 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the Web Application Firewall policy for the endpoint (if applicable). + */ +@Fluent +public final class EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + implements JsonSerializable { + /* + * Resource ID. + */ + private String id; + + /** + * Creates an instance of EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink class. + */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink object itself. + */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink. + */ + public static EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink deserializedEndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + = new EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.id + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointProvisioningState.java new file mode 100644 index 000000000000..8d98dd5530bd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning status of the endpoint. + */ +public final class EndpointProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for EndpointProvisioningState. + */ + public static final EndpointProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for EndpointProvisioningState. + */ + public static final EndpointProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Updating for EndpointProvisioningState. + */ + public static final EndpointProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for EndpointProvisioningState. + */ + public static final EndpointProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Creating for EndpointProvisioningState. + */ + public static final EndpointProvisioningState CREATING = fromString("Creating"); + + /** + * Creates a new instance of EndpointProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EndpointProvisioningState() { + } + + /** + * Creates or finds a EndpointProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointProvisioningState. + */ + public static EndpointProvisioningState fromString(String name) { + return fromString(name, EndpointProvisioningState.class); + } + + /** + * Gets known EndpointProvisioningState values. + * + * @return known EndpointProvisioningState values. + */ + public static Collection values() { + return values(EndpointProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointResourceState.java new file mode 100644 index 000000000000..9000ca388788 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointResourceState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource status of the endpoint. + */ +public final class EndpointResourceState extends ExpandableStringEnum { + /** + * Static value Creating for EndpointResourceState. + */ + public static final EndpointResourceState CREATING = fromString("Creating"); + + /** + * Static value Deleting for EndpointResourceState. + */ + public static final EndpointResourceState DELETING = fromString("Deleting"); + + /** + * Static value Running for EndpointResourceState. + */ + public static final EndpointResourceState RUNNING = fromString("Running"); + + /** + * Static value Starting for EndpointResourceState. + */ + public static final EndpointResourceState STARTING = fromString("Starting"); + + /** + * Static value Stopped for EndpointResourceState. + */ + public static final EndpointResourceState STOPPED = fromString("Stopped"); + + /** + * Static value Stopping for EndpointResourceState. + */ + public static final EndpointResourceState STOPPING = fromString("Stopping"); + + /** + * Creates a new instance of EndpointResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EndpointResourceState() { + } + + /** + * Creates or finds a EndpointResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointResourceState. + */ + public static EndpointResourceState fromString(String name) { + return fromString(name, EndpointResourceState.class); + } + + /** + * Gets known EndpointResourceState values. + * + * @return known EndpointResourceState values. + */ + public static Collection values() { + return values(EndpointResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointUpdateParameters.java new file mode 100644 index 000000000000..8e00842f4931 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointUpdateParameters.java @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointPropertiesUpdateParameters; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties required to create or update an endpoint. + */ +@Fluent +public final class EndpointUpdateParameters implements JsonSerializable { + /* + * Endpoint tags. + */ + private Map tags; + + /* + * The JSON object containing endpoint update parameters. + */ + private EndpointPropertiesUpdateParameters innerProperties; + + /** + * Creates an instance of EndpointUpdateParameters class. + */ + public EndpointUpdateParameters() { + } + + /** + * Get the tags property: Endpoint tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Endpoint tags. + * + * @param tags the tags value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: The JSON object containing endpoint update parameters. + * + * @return the innerProperties value. + */ + private EndpointPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.innerProperties() == null ? null : this.innerProperties().originPath(); + } + + /** + * Set the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withOriginPath(String originPath) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withOriginPath(originPath); + return this; + } + + /** + * Get the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + public List contentTypesToCompress() { + return this.innerProperties() == null ? null : this.innerProperties().contentTypesToCompress(); + } + + /** + * Set the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withContentTypesToCompress(List contentTypesToCompress) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withContentTypesToCompress(contentTypesToCompress); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public Boolean isCompressionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isCompressionEnabled(); + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withIsCompressionEnabled(Boolean isCompressionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withIsCompressionEnabled(isCompressionEnabled); + return this; + } + + /** + * Get the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value. + */ + public Boolean isHttpAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().isHttpAllowed(); + } + + /** + * Set the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpAllowed the isHttpAllowed value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withIsHttpAllowed(Boolean isHttpAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withIsHttpAllowed(isHttpAllowed); + return this; + } + + /** + * Get the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value. + */ + public Boolean isHttpsAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().isHttpsAllowed(); + } + + /** + * Set the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpsAllowed the isHttpsAllowed value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withIsHttpsAllowed(Boolean isHttpsAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withIsHttpsAllowed(isHttpsAllowed); + return this; + } + + /** + * Get the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @return the queryStringCachingBehavior value. + */ + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().queryStringCachingBehavior(); + } + + /** + * Set the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters + withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } + + /** + * Get the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @return the optimizationType value. + */ + public OptimizationType optimizationType() { + return this.innerProperties() == null ? null : this.innerProperties().optimizationType(); + } + + /** + * Set the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @param optimizationType the optimizationType value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withOptimizationType(OptimizationType optimizationType) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withOptimizationType(optimizationType); + return this; + } + + /** + * Get the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @return the probePath value. + */ + public String probePath() { + return this.innerProperties() == null ? null : this.innerProperties().probePath(); + } + + /** + * Set the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @param probePath the probePath value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withProbePath(String probePath) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withProbePath(probePath); + return this; + } + + /** + * Get the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value. + */ + public List geoFilters() { + return this.innerProperties() == null ? null : this.innerProperties().geoFilters(); + } + + /** + * Set the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @param geoFilters the geoFilters value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withGeoFilters(List geoFilters) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withGeoFilters(geoFilters); + return this; + } + + /** + * Get the defaultOriginGroup property: A reference to the origin group. + * + * @return the defaultOriginGroup value. + */ + public ResourceReference defaultOriginGroup() { + return this.innerProperties() == null ? null : this.innerProperties().defaultOriginGroup(); + } + + /** + * Set the defaultOriginGroup property: A reference to the origin group. + * + * @param defaultOriginGroup the defaultOriginGroup value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withDefaultOriginGroup(defaultOriginGroup); + return this; + } + + /** + * Get the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @return the urlSigningKeys value. + */ + public List urlSigningKeys() { + return this.innerProperties() == null ? null : this.innerProperties().urlSigningKeys(); + } + + /** + * Set the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @param urlSigningKeys the urlSigningKeys value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withUrlSigningKeys(List urlSigningKeys) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withUrlSigningKeys(urlSigningKeys); + return this; + } + + /** + * Get the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().deliveryPolicy(); + } + + /** + * Set the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @param deliveryPolicy the deliveryPolicy value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters + withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withDeliveryPolicy(deliveryPolicy); + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.innerProperties() == null ? null : this.innerProperties().webApplicationFirewallPolicyLink(); + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointUpdateParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointUpdateParameters. + */ + public static EndpointUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointUpdateParameters deserializedEndpointUpdateParameters = new EndpointUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEndpointUpdateParameters.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedEndpointUpdateParameters.innerProperties + = EndpointPropertiesUpdateParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointUpdateParameters; + }); + } +} 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 000000000000..69213003e892 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoints.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Endpoints. + */ +public interface Endpoints { + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + */ + Endpoint get(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint start(String resourceGroupName, String profileName, String endpointName); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint start(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint stop(String resourceGroupName, String profileName, String endpointName); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint stop(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeContent(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeContent(String resourceGroupName, String profileName, String endpointName, + PurgeParameters contentFilePaths, Context context); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void loadContent(String resourceGroupName, String profileName, String endpointName, + LoadParameters contentFilePaths); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void loadContent(String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + Response validateCustomDomainWithResponse(String resourceGroupName, String profileName, + String endpointName, ValidateCustomDomainInput customDomainProperties, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + ValidateCustomDomainOutput validateCustomDomain(String resourceGroupName, String profileName, String endpointName, + ValidateCustomDomainInput customDomainProperties); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + Endpoint getById(String id); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Endpoint resource. + * + * @param name resource name. + * @return the first stage of the new Endpoint definition. + */ + Endpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ForwardingProtocol.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ForwardingProtocol.java new file mode 100644 index 000000000000..07a7fe6c94a1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ForwardingProtocol.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Protocol this rule will use when forwarding traffic to backends. + */ +public final class ForwardingProtocol extends ExpandableStringEnum { + /** + * Static value HttpOnly for ForwardingProtocol. + */ + public static final ForwardingProtocol HTTP_ONLY = fromString("HttpOnly"); + + /** + * Static value HttpsOnly for ForwardingProtocol. + */ + public static final ForwardingProtocol HTTPS_ONLY = fromString("HttpsOnly"); + + /** + * Static value MatchRequest for ForwardingProtocol. + */ + public static final ForwardingProtocol MATCH_REQUEST = fromString("MatchRequest"); + + /** + * Creates a new instance of ForwardingProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ForwardingProtocol() { + } + + /** + * Creates or finds a ForwardingProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ForwardingProtocol. + */ + public static ForwardingProtocol fromString(String name) { + return fromString(name, ForwardingProtocol.class); + } + + /** + * Gets known ForwardingProtocol values. + * + * @return known ForwardingProtocol values. + */ + public static Collection values() { + return values(ForwardingProtocol.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilter.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilter.java new file mode 100644 index 000000000000..687d66540b3c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilter.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Rules defining user's geo access within a CDN endpoint. + */ +@Fluent +public final class GeoFilter implements JsonSerializable { + /* + * Relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.) + */ + private String relativePath; + + /* + * Action of the geo filter, i.e. allow or block access. + */ + private GeoFilterActions action; + + /* + * Two letter country or region codes defining user country or region access in a geo filter, e.g. AU, MX, US. + */ + private List countryCodes; + + /** + * Creates an instance of GeoFilter class. + */ + public GeoFilter() { + } + + /** + * Get the relativePath property: Relative path applicable to geo filter. (e.g. '/mypictures', + * '/mypicture/kitty.jpg', and etc.). + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: Relative path applicable to geo filter. (e.g. '/mypictures', + * '/mypicture/kitty.jpg', and etc.). + * + * @param relativePath the relativePath value to set. + * @return the GeoFilter object itself. + */ + public GeoFilter withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the action property: Action of the geo filter, i.e. allow or block access. + * + * @return the action value. + */ + public GeoFilterActions action() { + return this.action; + } + + /** + * Set the action property: Action of the geo filter, i.e. allow or block access. + * + * @param action the action value to set. + * @return the GeoFilter object itself. + */ + public GeoFilter withAction(GeoFilterActions action) { + this.action = action; + return this; + } + + /** + * Get the countryCodes property: Two letter country or region codes defining user country or region access in a geo + * filter, e.g. AU, MX, US. + * + * @return the countryCodes value. + */ + public List countryCodes() { + return this.countryCodes; + } + + /** + * Set the countryCodes property: Two letter country or region codes defining user country or region access in a geo + * filter, e.g. AU, MX, US. + * + * @param countryCodes the countryCodes value to set. + * @return the GeoFilter object itself. + */ + public GeoFilter withCountryCodes(List countryCodes) { + this.countryCodes = countryCodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (relativePath() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property relativePath in model GeoFilter")); + } + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model GeoFilter")); + } + if (countryCodes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property countryCodes in model GeoFilter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GeoFilter.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("relativePath", this.relativePath); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeArrayField("countryCodes", this.countryCodes, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GeoFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GeoFilter if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GeoFilter. + */ + public static GeoFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GeoFilter deserializedGeoFilter = new GeoFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("relativePath".equals(fieldName)) { + deserializedGeoFilter.relativePath = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedGeoFilter.action = GeoFilterActions.fromString(reader.getString()); + } else if ("countryCodes".equals(fieldName)) { + List countryCodes = reader.readArray(reader1 -> reader1.getString()); + deserializedGeoFilter.countryCodes = countryCodes; + } else { + reader.skipChildren(); + } + } + + return deserializedGeoFilter; + }); + } +} 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 000000000000..ff37b339c6d4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilterActions.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; + +/** + * Action of the geo filter, i.e. allow or block access. + */ +public enum GeoFilterActions { + /** + * Enum value Block. + */ + BLOCK("Block"), + + /** + * Enum value Allow. + */ + ALLOW("Allow"); + + /** + * The actual serialized value for a GeoFilterActions instance. + */ + private final String value; + + GeoFilterActions(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a GeoFilterActions instance. + * + * @param value the serialized value to parse. + * @return the parsed GeoFilterActions object, or null if unable to parse. + */ + public static GeoFilterActions fromString(String value) { + if (value == null) { + return null; + } + GeoFilterActions[] items = GeoFilterActions.values(); + for (GeoFilterActions item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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 000000000000..5f0472c61c47 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderAction.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Action to perform. + */ +public final class HeaderAction extends ExpandableStringEnum { + /** + * Static value Append for HeaderAction. + */ + public static final HeaderAction APPEND = fromString("Append"); + + /** + * Static value Overwrite for HeaderAction. + */ + public static final HeaderAction OVERWRITE = fromString("Overwrite"); + + /** + * Static value Delete for HeaderAction. + */ + public static final HeaderAction DELETE = fromString("Delete"); + + /** + * Creates a new instance of HeaderAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HeaderAction() { + } + + /** + * Creates or finds a HeaderAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding HeaderAction. + */ + public static HeaderAction fromString(String name) { + return fromString(name, HeaderAction.class); + } + + /** + * Gets known HeaderAction values. + * + * @return known HeaderAction values. + */ + public static Collection values() { + return values(HeaderAction.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderActionParameters.java new file mode 100644 index 000000000000..4e55684bc1cf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderActionParameters.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for the request header action. + */ +@Fluent +public final class HeaderActionParameters extends DeliveryRuleActionParameters { + /* + * The typeName property. + */ + private DeliveryRuleActionParametersType typeName + = DeliveryRuleActionParametersType.DELIVERY_RULE_HEADER_ACTION_PARAMETERS; + + /* + * Action to perform + */ + private HeaderAction headerAction; + + /* + * Name of the header to modify + */ + private String headerName; + + /* + * Value for the specified action + */ + private String value; + + /** + * Creates an instance of HeaderActionParameters class. + */ + public HeaderActionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleActionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (headerAction() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property headerAction in model HeaderActionParameters")); + } + if (headerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property headerName in model HeaderActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HeaderActionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("headerAction", this.headerAction == null ? null : this.headerAction.toString()); + jsonWriter.writeStringField("headerName", this.headerName); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HeaderActionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeaderActionParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HeaderActionParameters. + */ + public static HeaderActionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeaderActionParameters deserializedHeaderActionParameters = new HeaderActionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("headerAction".equals(fieldName)) { + deserializedHeaderActionParameters.headerAction = HeaderAction.fromString(reader.getString()); + } else if ("headerName".equals(fieldName)) { + deserializedHeaderActionParameters.headerName = reader.getString(); + } else if ("typeName".equals(fieldName)) { + deserializedHeaderActionParameters.typeName + = DeliveryRuleActionParametersType.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedHeaderActionParameters.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHeaderActionParameters; + }); + } +} 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 000000000000..a2586570d194 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeParameters.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The JSON object that contains the properties to send health probes to origin. + */ +@Fluent +public final class HealthProbeParameters implements JsonSerializable { + /* + * The path relative to the origin that is used to determine the health of the origin. + */ + private String probePath; + + /* + * The type of health probe request that is made. + */ + private HealthProbeRequestType probeRequestType; + + /* + * Protocol to use for health probe. + */ + private ProbeProtocol probeProtocol; + + /* + * The number of seconds between health probes.Default is 240sec. + */ + private Integer probeIntervalInSeconds; + + /** + * Creates an instance of HealthProbeParameters class. + */ + public HealthProbeParameters() { + } + + /** + * Get the probePath property: The path relative to the origin that is used to determine the health of the origin. + * + * @return the probePath value. + */ + public String probePath() { + return this.probePath; + } + + /** + * Set the probePath property: The path relative to the origin that is used to determine the health of the origin. + * + * @param probePath the probePath value to set. + * @return the HealthProbeParameters object itself. + */ + public HealthProbeParameters withProbePath(String probePath) { + this.probePath = probePath; + return this; + } + + /** + * Get the probeRequestType property: The type of health probe request that is made. + * + * @return the probeRequestType value. + */ + public HealthProbeRequestType probeRequestType() { + return this.probeRequestType; + } + + /** + * Set the probeRequestType property: The type of health probe request that is made. + * + * @param probeRequestType the probeRequestType value to set. + * @return the HealthProbeParameters object itself. + */ + public HealthProbeParameters withProbeRequestType(HealthProbeRequestType probeRequestType) { + this.probeRequestType = probeRequestType; + return this; + } + + /** + * Get the probeProtocol property: Protocol to use for health probe. + * + * @return the probeProtocol value. + */ + public ProbeProtocol probeProtocol() { + return this.probeProtocol; + } + + /** + * Set the probeProtocol property: Protocol to use for health probe. + * + * @param probeProtocol the probeProtocol value to set. + * @return the HealthProbeParameters object itself. + */ + public HealthProbeParameters withProbeProtocol(ProbeProtocol probeProtocol) { + this.probeProtocol = probeProtocol; + return this; + } + + /** + * Get the probeIntervalInSeconds property: The number of seconds between health probes.Default is 240sec. + * + * @return the probeIntervalInSeconds value. + */ + public Integer probeIntervalInSeconds() { + return this.probeIntervalInSeconds; + } + + /** + * Set the probeIntervalInSeconds property: The number of seconds between health probes.Default is 240sec. + * + * @param probeIntervalInSeconds the probeIntervalInSeconds value to set. + * @return the HealthProbeParameters object itself. + */ + public HealthProbeParameters withProbeIntervalInSeconds(Integer probeIntervalInSeconds) { + this.probeIntervalInSeconds = probeIntervalInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("probePath", this.probePath); + jsonWriter.writeStringField("probeRequestType", + this.probeRequestType == null ? null : this.probeRequestType.toString()); + jsonWriter.writeStringField("probeProtocol", this.probeProtocol == null ? null : this.probeProtocol.toString()); + jsonWriter.writeNumberField("probeIntervalInSeconds", this.probeIntervalInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HealthProbeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HealthProbeParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HealthProbeParameters. + */ + public static HealthProbeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HealthProbeParameters deserializedHealthProbeParameters = new HealthProbeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("probePath".equals(fieldName)) { + deserializedHealthProbeParameters.probePath = reader.getString(); + } else if ("probeRequestType".equals(fieldName)) { + deserializedHealthProbeParameters.probeRequestType + = HealthProbeRequestType.fromString(reader.getString()); + } else if ("probeProtocol".equals(fieldName)) { + deserializedHealthProbeParameters.probeProtocol = ProbeProtocol.fromString(reader.getString()); + } else if ("probeIntervalInSeconds".equals(fieldName)) { + deserializedHealthProbeParameters.probeIntervalInSeconds = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedHealthProbeParameters; + }); + } +} 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 000000000000..2abbeaca1b4c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeRequestType.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; + +/** + * The type of health probe request that is made. + */ +public enum HealthProbeRequestType { + /** + * Enum value NotSet. + */ + NOT_SET("NotSet"), + + /** + * Enum value GET. + */ + GET("GET"), + + /** + * Enum value HEAD. + */ + HEAD("HEAD"); + + /** + * The actual serialized value for a HealthProbeRequestType instance. + */ + private final String value; + + HealthProbeRequestType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HealthProbeRequestType instance. + * + * @param value the serialized value to parse. + * @return the parsed HealthProbeRequestType object, or null if unable to parse. + */ + public static HealthProbeRequestType fromString(String value) { + if (value == null) { + return null; + } + HealthProbeRequestType[] items = HealthProbeRequestType.values(); + for (HealthProbeRequestType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameMatchConditionParameters.java new file mode 100644 index 000000000000..dccc8abc83c9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for HostName match conditions. + */ +@Fluent +public final class HostnameMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_HOST_NAME_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private HostnameOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of HostnameMatchConditionParameters class. + */ + public HostnameMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public HostnameOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the HostnameMatchConditionParameters object itself. + */ + public HostnameMatchConditionParameters withOperator(HostnameOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the HostnameMatchConditionParameters object itself. + */ + public HostnameMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the HostnameMatchConditionParameters object itself. + */ + public HostnameMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the HostnameMatchConditionParameters object itself. + */ + public HostnameMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model HostnameMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HostnameMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostnameMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostnameMatchConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HostnameMatchConditionParameters. + */ + public static HostnameMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostnameMatchConditionParameters deserializedHostnameMatchConditionParameters + = new HostnameMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedHostnameMatchConditionParameters.operator + = HostnameOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedHostnameMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedHostnameMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedHostnameMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedHostnameMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedHostnameMatchConditionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameOperator.java new file mode 100644 index 000000000000..67f5624ed55d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class HostnameOperator extends ExpandableStringEnum { + /** + * Static value Any for HostnameOperator. + */ + public static final HostnameOperator ANY = fromString("Any"); + + /** + * Static value Equal for HostnameOperator. + */ + public static final HostnameOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for HostnameOperator. + */ + public static final HostnameOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for HostnameOperator. + */ + public static final HostnameOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for HostnameOperator. + */ + public static final HostnameOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for HostnameOperator. + */ + public static final HostnameOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for HostnameOperator. + */ + public static final HostnameOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for HostnameOperator. + */ + public static final HostnameOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for HostnameOperator. + */ + public static final HostnameOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for HostnameOperator. + */ + public static final HostnameOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of HostnameOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HostnameOperator() { + } + + /** + * Creates or finds a HostnameOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostnameOperator. + */ + public static HostnameOperator fromString(String name) { + return fromString(name, HostnameOperator.class); + } + + /** + * Gets known HostnameOperator values. + * + * @return known HostnameOperator values. + */ + public static Collection values() { + return values(HostnameOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpErrorRangeParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpErrorRangeParameters.java new file mode 100644 index 000000000000..5a2771a77a95 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpErrorRangeParameters.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The JSON object that represents the range for http status codes. + */ +@Fluent +public final class HttpErrorRangeParameters implements JsonSerializable { + /* + * The inclusive start of the http status code range. + */ + private Integer begin; + + /* + * The inclusive end of the http status code range. + */ + private Integer end; + + /** + * Creates an instance of HttpErrorRangeParameters class. + */ + public HttpErrorRangeParameters() { + } + + /** + * Get the begin property: The inclusive start of the http status code range. + * + * @return the begin value. + */ + public Integer begin() { + return this.begin; + } + + /** + * Set the begin property: The inclusive start of the http status code range. + * + * @param begin the begin value to set. + * @return the HttpErrorRangeParameters object itself. + */ + public HttpErrorRangeParameters withBegin(Integer begin) { + this.begin = begin; + return this; + } + + /** + * Get the end property: The inclusive end of the http status code range. + * + * @return the end value. + */ + public Integer end() { + return this.end; + } + + /** + * Set the end property: The inclusive end of the http status code range. + * + * @param end the end value to set. + * @return the HttpErrorRangeParameters object itself. + */ + public HttpErrorRangeParameters withEnd(Integer end) { + this.end = end; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("begin", this.begin); + jsonWriter.writeNumberField("end", this.end); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpErrorRangeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpErrorRangeParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpErrorRangeParameters. + */ + public static HttpErrorRangeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpErrorRangeParameters deserializedHttpErrorRangeParameters = new HttpErrorRangeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("begin".equals(fieldName)) { + deserializedHttpErrorRangeParameters.begin = reader.getNullable(JsonReader::getInt); + } else if ("end".equals(fieldName)) { + deserializedHttpErrorRangeParameters.end = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpErrorRangeParameters; + }); + } +} 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 000000000000..2193967f2309 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for HttpVersion match conditions. + */ +@Fluent +public final class HttpVersionMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_HTTP_VERSION_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private HttpVersionOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of HttpVersionMatchConditionParameters class. + */ + public HttpVersionMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public HttpVersionOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withOperator(HttpVersionOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model HttpVersionMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HttpVersionMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpVersionMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpVersionMatchConditionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HttpVersionMatchConditionParameters. + */ + public static HttpVersionMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpVersionMatchConditionParameters deserializedHttpVersionMatchConditionParameters + = new HttpVersionMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedHttpVersionMatchConditionParameters.operator + = HttpVersionOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedHttpVersionMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedHttpVersionMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedHttpVersionMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedHttpVersionMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedHttpVersionMatchConditionParameters; + }); + } +} 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 000000000000..714ebc8f24f9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionOperator.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 java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class HttpVersionOperator extends ExpandableStringEnum { + /** + * Static value Equal for HttpVersionOperator. + */ + public static final HttpVersionOperator EQUAL = fromString("Equal"); + + /** + * Creates a new instance of HttpVersionOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HttpVersionOperator() { + } + + /** + * Creates or finds a HttpVersionOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpVersionOperator. + */ + public static HttpVersionOperator fromString(String name) { + return fromString(name, HttpVersionOperator.class); + } + + /** + * Gets known HttpVersionOperator values. + * + * @return known HttpVersionOperator values. + */ + public static Collection values() { + return values(HttpVersionOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpsRedirect.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpsRedirect.java new file mode 100644 index 000000000000..22ff02f5589b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpsRedirect.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 java.util.Collection; + +/** + * Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and + * it will be the first rule that gets executed. + */ +public final class HttpsRedirect extends ExpandableStringEnum { + /** + * Static value Enabled for HttpsRedirect. + */ + public static final HttpsRedirect ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for HttpsRedirect. + */ + public static final HttpsRedirect DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of HttpsRedirect value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HttpsRedirect() { + } + + /** + * Creates or finds a HttpsRedirect from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpsRedirect. + */ + public static HttpsRedirect fromString(String name) { + return fromString(name, HttpsRedirect.class); + } + + /** + * Gets known HttpsRedirect values. + * + * @return known HttpsRedirect values. + */ + public static Collection values() { + return values(HttpsRedirect.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IpAddressGroup.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IpAddressGroup.java new file mode 100644 index 000000000000..6db6d9ea5aee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IpAddressGroup.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * CDN Ip address group. + */ +@Fluent +public final class IpAddressGroup implements JsonSerializable { + /* + * The delivery region of the ip address group + */ + private String deliveryRegion; + + /* + * The list of ip v4 addresses. + */ + private List ipv4Addresses; + + /* + * The list of ip v6 addresses. + */ + private List ipv6Addresses; + + /** + * Creates an instance of IpAddressGroup class. + */ + public IpAddressGroup() { + } + + /** + * Get the deliveryRegion property: The delivery region of the ip address group. + * + * @return the deliveryRegion value. + */ + public String deliveryRegion() { + return this.deliveryRegion; + } + + /** + * Set the deliveryRegion property: The delivery region of the ip address group. + * + * @param deliveryRegion the deliveryRegion value to set. + * @return the IpAddressGroup object itself. + */ + public IpAddressGroup withDeliveryRegion(String deliveryRegion) { + this.deliveryRegion = deliveryRegion; + return this; + } + + /** + * Get the ipv4Addresses property: The list of ip v4 addresses. + * + * @return the ipv4Addresses value. + */ + public List ipv4Addresses() { + return this.ipv4Addresses; + } + + /** + * Set the ipv4Addresses property: The list of ip v4 addresses. + * + * @param ipv4Addresses the ipv4Addresses value to set. + * @return the IpAddressGroup object itself. + */ + public IpAddressGroup withIpv4Addresses(List ipv4Addresses) { + this.ipv4Addresses = ipv4Addresses; + return this; + } + + /** + * Get the ipv6Addresses property: The list of ip v6 addresses. + * + * @return the ipv6Addresses value. + */ + public List ipv6Addresses() { + return this.ipv6Addresses; + } + + /** + * Set the ipv6Addresses property: The list of ip v6 addresses. + * + * @param ipv6Addresses the ipv6Addresses value to set. + * @return the IpAddressGroup object itself. + */ + public IpAddressGroup withIpv6Addresses(List ipv6Addresses) { + this.ipv6Addresses = ipv6Addresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipv4Addresses() != null) { + ipv4Addresses().forEach(e -> e.validate()); + } + if (ipv6Addresses() != null) { + ipv6Addresses().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deliveryRegion", this.deliveryRegion); + jsonWriter.writeArrayField("ipv4Addresses", this.ipv4Addresses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipv6Addresses", this.ipv6Addresses, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAddressGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAddressGroup if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpAddressGroup. + */ + public static IpAddressGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAddressGroup deserializedIpAddressGroup = new IpAddressGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deliveryRegion".equals(fieldName)) { + deserializedIpAddressGroup.deliveryRegion = reader.getString(); + } else if ("ipv4Addresses".equals(fieldName)) { + List ipv4Addresses = reader.readArray(reader1 -> CidrIpAddress.fromJson(reader1)); + deserializedIpAddressGroup.ipv4Addresses = ipv4Addresses; + } else if ("ipv6Addresses".equals(fieldName)) { + List ipv6Addresses = reader.readArray(reader1 -> CidrIpAddress.fromJson(reader1)); + deserializedIpAddressGroup.ipv6Addresses = ipv6Addresses; + } else { + reader.skipChildren(); + } + } + + return deserializedIpAddressGroup; + }); + } +} 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 000000000000..93f547b65410 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParameters.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for IsDevice match conditions. + */ +@Fluent +public final class IsDeviceMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_IS_DEVICE_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private IsDeviceOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of IsDeviceMatchConditionParameters class. + */ + public IsDeviceMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model IsDeviceMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IsDeviceMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IsDeviceMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IsDeviceMatchConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IsDeviceMatchConditionParameters. + */ + public static IsDeviceMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IsDeviceMatchConditionParameters deserializedIsDeviceMatchConditionParameters + = new IsDeviceMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedIsDeviceMatchConditionParameters.operator + = IsDeviceOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedIsDeviceMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedIsDeviceMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues + = reader.readArray(reader1 -> IsDeviceMatchValue.fromString(reader1.getString())); + deserializedIsDeviceMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedIsDeviceMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedIsDeviceMatchConditionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchValue.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchValue.java new file mode 100644 index 000000000000..347cc4ab2745 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchValue.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for IsDeviceMatchValue. + */ +public final class IsDeviceMatchValue extends ExpandableStringEnum { + /** + * Static value Mobile for IsDeviceMatchValue. + */ + public static final IsDeviceMatchValue MOBILE = fromString("Mobile"); + + /** + * Static value Desktop for IsDeviceMatchValue. + */ + public static final IsDeviceMatchValue DESKTOP = fromString("Desktop"); + + /** + * Creates a new instance of IsDeviceMatchValue value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsDeviceMatchValue() { + } + + /** + * Creates or finds a IsDeviceMatchValue from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsDeviceMatchValue. + */ + public static IsDeviceMatchValue fromString(String name) { + return fromString(name, IsDeviceMatchValue.class); + } + + /** + * Gets known IsDeviceMatchValue values. + * + * @return known IsDeviceMatchValue values. + */ + public static Collection values() { + return values(IsDeviceMatchValue.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 000000000000..25092eb6bdf6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceOperator.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 java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class IsDeviceOperator extends ExpandableStringEnum { + /** + * Static value Equal for IsDeviceOperator. + */ + public static final IsDeviceOperator EQUAL = fromString("Equal"); + + /** + * Creates a new instance of IsDeviceOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsDeviceOperator() { + } + + /** + * Creates or finds a IsDeviceOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsDeviceOperator. + */ + public static IsDeviceOperator fromString(String name) { + return fromString(name, IsDeviceOperator.class); + } + + /** + * Gets known IsDeviceOperator values. + * + * @return known IsDeviceOperator values. + */ + public static Collection values() { + return values(IsDeviceOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultCertificateSourceParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultCertificateSourceParameters.java new file mode 100644 index 000000000000..4bb99711d64e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultCertificateSourceParameters.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the parameters for using a user's KeyVault certificate for securing custom domain. + */ +@Fluent +public final class KeyVaultCertificateSourceParameters extends CertificateSourceParameters { + /* + * The typeName property. + */ + private CertificateSourceParametersType typeName + = CertificateSourceParametersType.KEY_VAULT_CERTIFICATE_SOURCE_PARAMETERS; + + /* + * Subscription Id of the user's Key Vault containing the SSL certificate + */ + private String subscriptionId; + + /* + * Resource group of the user's Key Vault containing the SSL certificate + */ + private String resourceGroupName; + + /* + * The name of the user's Key Vault containing the SSL certificate + */ + private String vaultName; + + /* + * The name of Key Vault Secret (representing the full certificate PFX) in Key Vault. + */ + private String secretName; + + /* + * The version(GUID) of Key Vault Secret in Key Vault. + */ + private String secretVersion; + + /* + * Describes the action that shall be taken when the certificate is updated in Key Vault. + */ + private UpdateRule updateRule; + + /* + * Describes the action that shall be taken when the certificate is removed from Key Vault. + */ + private DeleteRule deleteRule; + + /** + * Creates an instance of KeyVaultCertificateSourceParameters class. + */ + public KeyVaultCertificateSourceParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public CertificateSourceParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (subscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property subscriptionId in model KeyVaultCertificateSourceParameters")); + } + if (resourceGroupName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resourceGroupName in model KeyVaultCertificateSourceParameters")); + } + if (vaultName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vaultName in model KeyVaultCertificateSourceParameters")); + } + if (secretName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secretName in model KeyVaultCertificateSourceParameters")); + } + if (updateRule() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property updateRule in model KeyVaultCertificateSourceParameters")); + } + if (deleteRule() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property deleteRule in model KeyVaultCertificateSourceParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultCertificateSourceParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("resourceGroupName", this.resourceGroupName); + jsonWriter.writeStringField("vaultName", this.vaultName); + jsonWriter.writeStringField("secretName", this.secretName); + jsonWriter.writeStringField("updateRule", this.updateRule == null ? null : this.updateRule.toString()); + jsonWriter.writeStringField("deleteRule", this.deleteRule == null ? null : this.deleteRule.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("secretVersion", this.secretVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultCertificateSourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultCertificateSourceParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KeyVaultCertificateSourceParameters. + */ + public static KeyVaultCertificateSourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultCertificateSourceParameters deserializedKeyVaultCertificateSourceParameters + = new KeyVaultCertificateSourceParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptionId".equals(fieldName)) { + deserializedKeyVaultCertificateSourceParameters.subscriptionId = reader.getString(); + } else if ("resourceGroupName".equals(fieldName)) { + deserializedKeyVaultCertificateSourceParameters.resourceGroupName = reader.getString(); + } else if ("vaultName".equals(fieldName)) { + deserializedKeyVaultCertificateSourceParameters.vaultName = reader.getString(); + } else if ("secretName".equals(fieldName)) { + deserializedKeyVaultCertificateSourceParameters.secretName = reader.getString(); + } else if ("updateRule".equals(fieldName)) { + deserializedKeyVaultCertificateSourceParameters.updateRule + = UpdateRule.fromString(reader.getString()); + } else if ("deleteRule".equals(fieldName)) { + deserializedKeyVaultCertificateSourceParameters.deleteRule + = DeleteRule.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedKeyVaultCertificateSourceParameters.typeName + = CertificateSourceParametersType.fromString(reader.getString()); + } else if ("secretVersion".equals(fieldName)) { + deserializedKeyVaultCertificateSourceParameters.secretVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultCertificateSourceParameters; + }); + } +} 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 000000000000..68e13122e42a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultSigningKeyParameters.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the parameters for using a user's KeyVault for URL Signing Key. + */ +@Fluent +public final class KeyVaultSigningKeyParameters implements JsonSerializable { + /* + * The typeName property. + */ + private KeyVaultSigningKeyParametersType typeName; + + /* + * Subscription Id of the user's Key Vault containing the secret + */ + private String subscriptionId; + + /* + * Resource group of the user's Key Vault containing the secret + */ + private String resourceGroupName; + + /* + * The name of the user's Key Vault containing the secret + */ + private String vaultName; + + /* + * The name of secret in Key Vault. + */ + private String secretName; + + /* + * The version(GUID) of secret in Key Vault. + */ + private String secretVersion; + + /** + * Creates an instance of KeyVaultSigningKeyParameters class. + */ + public KeyVaultSigningKeyParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public KeyVaultSigningKeyParametersType typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withTypeName(KeyVaultSigningKeyParametersType typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the subscriptionId property: Subscription Id of the user's Key Vault containing the secret. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription Id of the user's Key Vault containing the secret. + * + * @param subscriptionId the subscriptionId value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the resourceGroupName property: Resource group of the user's Key Vault containing the secret. + * + * @return the resourceGroupName value. + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Set the resourceGroupName property: Resource group of the user's Key Vault containing the secret. + * + * @param resourceGroupName the resourceGroupName value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + /** + * Get the vaultName property: The name of the user's Key Vault containing the secret. + * + * @return the vaultName value. + */ + public String vaultName() { + return this.vaultName; + } + + /** + * Set the vaultName property: The name of the user's Key Vault containing the secret. + * + * @param vaultName the vaultName value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withVaultName(String vaultName) { + this.vaultName = vaultName; + return this; + } + + /** + * Get the secretName property: The name of secret in Key Vault. + * + * @return the secretName value. + */ + public String secretName() { + return this.secretName; + } + + /** + * Set the secretName property: The name of secret in Key Vault. + * + * @param secretName the secretName value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withSecretName(String secretName) { + this.secretName = secretName; + return this; + } + + /** + * Get the secretVersion property: The version(GUID) of secret in Key Vault. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: The version(GUID) of secret in Key Vault. + * + * @param secretVersion the secretVersion value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (typeName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property typeName in model KeyVaultSigningKeyParameters")); + } + if (subscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property subscriptionId in model KeyVaultSigningKeyParameters")); + } + if (resourceGroupName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resourceGroupName in model KeyVaultSigningKeyParameters")); + } + if (vaultName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vaultName in model KeyVaultSigningKeyParameters")); + } + if (secretName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secretName in model KeyVaultSigningKeyParameters")); + } + if (secretVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secretVersion in model KeyVaultSigningKeyParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultSigningKeyParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("resourceGroupName", this.resourceGroupName); + jsonWriter.writeStringField("vaultName", this.vaultName); + jsonWriter.writeStringField("secretName", this.secretName); + jsonWriter.writeStringField("secretVersion", this.secretVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultSigningKeyParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultSigningKeyParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KeyVaultSigningKeyParameters. + */ + public static KeyVaultSigningKeyParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultSigningKeyParameters deserializedKeyVaultSigningKeyParameters = new KeyVaultSigningKeyParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("typeName".equals(fieldName)) { + deserializedKeyVaultSigningKeyParameters.typeName + = KeyVaultSigningKeyParametersType.fromString(reader.getString()); + } else if ("subscriptionId".equals(fieldName)) { + deserializedKeyVaultSigningKeyParameters.subscriptionId = reader.getString(); + } else if ("resourceGroupName".equals(fieldName)) { + deserializedKeyVaultSigningKeyParameters.resourceGroupName = reader.getString(); + } else if ("vaultName".equals(fieldName)) { + deserializedKeyVaultSigningKeyParameters.vaultName = reader.getString(); + } else if ("secretName".equals(fieldName)) { + deserializedKeyVaultSigningKeyParameters.secretName = reader.getString(); + } else if ("secretVersion".equals(fieldName)) { + deserializedKeyVaultSigningKeyParameters.secretVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultSigningKeyParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultSigningKeyParametersType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultSigningKeyParametersType.java new file mode 100644 index 000000000000..b1bee5437f33 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultSigningKeyParametersType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for KeyVaultSigningKeyParametersType. + */ +public final class KeyVaultSigningKeyParametersType extends ExpandableStringEnum { + /** + * Static value KeyVaultSigningKeyParameters for KeyVaultSigningKeyParametersType. + */ + public static final KeyVaultSigningKeyParametersType KEY_VAULT_SIGNING_KEY_PARAMETERS + = fromString("KeyVaultSigningKeyParameters"); + + /** + * Creates a new instance of KeyVaultSigningKeyParametersType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyVaultSigningKeyParametersType() { + } + + /** + * Creates or finds a KeyVaultSigningKeyParametersType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyVaultSigningKeyParametersType. + */ + public static KeyVaultSigningKeyParametersType fromString(String name) { + return fromString(name, KeyVaultSigningKeyParametersType.class); + } + + /** + * Gets known KeyVaultSigningKeyParametersType values. + * + * @return known KeyVaultSigningKeyParametersType values. + */ + public static Collection values() { + return values(KeyVaultSigningKeyParametersType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LinkToDefaultDomain.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LinkToDefaultDomain.java new file mode 100644 index 000000000000..a5eb4cfdcd9e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LinkToDefaultDomain.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * whether this route will be linked to the default endpoint domain. + */ +public final class LinkToDefaultDomain extends ExpandableStringEnum { + /** + * Static value Enabled for LinkToDefaultDomain. + */ + public static final LinkToDefaultDomain ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for LinkToDefaultDomain. + */ + public static final LinkToDefaultDomain DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of LinkToDefaultDomain value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinkToDefaultDomain() { + } + + /** + * Creates or finds a LinkToDefaultDomain from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinkToDefaultDomain. + */ + public static LinkToDefaultDomain fromString(String name) { + return fromString(name, LinkToDefaultDomain.class); + } + + /** + * Gets known LinkToDefaultDomain values. + * + * @return known LinkToDefaultDomain values. + */ + public static Collection values() { + return values(LinkToDefaultDomain.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadBalancingSettingsParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadBalancingSettingsParameters.java new file mode 100644 index 000000000000..09e6fec49d8d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadBalancingSettingsParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Round-Robin load balancing settings for a backend pool. + */ +@Fluent +public final class LoadBalancingSettingsParameters implements JsonSerializable { + /* + * The number of samples to consider for load balancing decisions + */ + private Integer sampleSize; + + /* + * The number of samples within the sample period that must succeed + */ + private Integer successfulSamplesRequired; + + /* + * The additional latency in milliseconds for probes to fall into the lowest latency bucket + */ + private Integer additionalLatencyInMilliseconds; + + /** + * Creates an instance of LoadBalancingSettingsParameters class. + */ + public LoadBalancingSettingsParameters() { + } + + /** + * Get the sampleSize property: The number of samples to consider for load balancing decisions. + * + * @return the sampleSize value. + */ + public Integer sampleSize() { + return this.sampleSize; + } + + /** + * Set the sampleSize property: The number of samples to consider for load balancing decisions. + * + * @param sampleSize the sampleSize value to set. + * @return the LoadBalancingSettingsParameters object itself. + */ + public LoadBalancingSettingsParameters withSampleSize(Integer sampleSize) { + this.sampleSize = sampleSize; + return this; + } + + /** + * Get the successfulSamplesRequired property: The number of samples within the sample period that must succeed. + * + * @return the successfulSamplesRequired value. + */ + public Integer successfulSamplesRequired() { + return this.successfulSamplesRequired; + } + + /** + * Set the successfulSamplesRequired property: The number of samples within the sample period that must succeed. + * + * @param successfulSamplesRequired the successfulSamplesRequired value to set. + * @return the LoadBalancingSettingsParameters object itself. + */ + public LoadBalancingSettingsParameters withSuccessfulSamplesRequired(Integer successfulSamplesRequired) { + this.successfulSamplesRequired = successfulSamplesRequired; + return this; + } + + /** + * Get the additionalLatencyInMilliseconds property: The additional latency in milliseconds for probes to fall into + * the lowest latency bucket. + * + * @return the additionalLatencyInMilliseconds value. + */ + public Integer additionalLatencyInMilliseconds() { + return this.additionalLatencyInMilliseconds; + } + + /** + * Set the additionalLatencyInMilliseconds property: The additional latency in milliseconds for probes to fall into + * the lowest latency bucket. + * + * @param additionalLatencyInMilliseconds the additionalLatencyInMilliseconds value to set. + * @return the LoadBalancingSettingsParameters object itself. + */ + public LoadBalancingSettingsParameters + withAdditionalLatencyInMilliseconds(Integer additionalLatencyInMilliseconds) { + this.additionalLatencyInMilliseconds = additionalLatencyInMilliseconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("sampleSize", this.sampleSize); + jsonWriter.writeNumberField("successfulSamplesRequired", this.successfulSamplesRequired); + jsonWriter.writeNumberField("additionalLatencyInMilliseconds", this.additionalLatencyInMilliseconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancingSettingsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancingSettingsParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancingSettingsParameters. + */ + public static LoadBalancingSettingsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancingSettingsParameters deserializedLoadBalancingSettingsParameters + = new LoadBalancingSettingsParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sampleSize".equals(fieldName)) { + deserializedLoadBalancingSettingsParameters.sampleSize = reader.getNullable(JsonReader::getInt); + } else if ("successfulSamplesRequired".equals(fieldName)) { + deserializedLoadBalancingSettingsParameters.successfulSamplesRequired + = reader.getNullable(JsonReader::getInt); + } else if ("additionalLatencyInMilliseconds".equals(fieldName)) { + deserializedLoadBalancingSettingsParameters.additionalLatencyInMilliseconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancingSettingsParameters; + }); + } +} 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 000000000000..ae8d0ac96c67 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadParameters.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters required for content load. + */ +@Fluent +public final class LoadParameters implements JsonSerializable { + /* + * The path to the content to be loaded. Path should be a relative file URL of the origin. + */ + private List contentPaths; + + /** + * Creates an instance of LoadParameters class. + */ + public LoadParameters() { + } + + /** + * Get the contentPaths property: The path to the content to be loaded. Path should be a relative file URL of the + * origin. + * + * @return the contentPaths value. + */ + public List contentPaths() { + return this.contentPaths; + } + + /** + * Set the contentPaths property: The path to the content to be loaded. Path should be a relative file URL of the + * origin. + * + * @param contentPaths the contentPaths value to set. + * @return the LoadParameters object itself. + */ + public LoadParameters withContentPaths(List contentPaths) { + this.contentPaths = contentPaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentPaths() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property contentPaths in model LoadParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoadParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("contentPaths", this.contentPaths, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LoadParameters. + */ + public static LoadParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadParameters deserializedLoadParameters = new LoadParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentPaths".equals(fieldName)) { + List contentPaths = reader.readArray(reader1 -> reader1.getString()); + deserializedLoadParameters.contentPaths = contentPaths; + } else { + reader.skipChildren(); + } + } + + return deserializedLoadParameters; + }); + } +} 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 000000000000..c8245c37ec2a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogAnalytics.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.Response; +import com.azure.core.util.Context; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Resource collection API of LogAnalytics. + */ +public interface LogAnalytics { + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains The customDomains parameter. + * @param protocols The protocols parameter. + * @param groupBy The groupBy parameter. + * @param continents The continents parameter. + * @param countryOrRegions The countryOrRegions parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log report for AFD profile along with {@link Response}. + */ + Response getLogAnalyticsMetricsWithResponse(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, List customDomains, List protocols, + List groupBy, List continents, List countryOrRegions, Context context); + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains The customDomains parameter. + * @param protocols The protocols 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 report for AFD profile. + */ + MetricsResponse getLogAnalyticsMetrics(String resourceGroupName, String profileName, List metrics, + OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, LogMetricsGranularity granularity, + List customDomains, List protocols); + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings The rankings parameter. + * @param metrics The metrics parameter. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains The customDomains parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile along with {@link Response}. + */ + Response getLogAnalyticsRankingsWithResponse(String resourceGroupName, String profileName, + List rankings, List metrics, int maxRanking, OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, List customDomains, Context context); + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings The rankings parameter. + * @param metrics The metrics parameter. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile. + */ + RankingsResponse getLogAnalyticsRankings(String resourceGroupName, String profileName, List rankings, + List metrics, int maxRanking, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd); + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response}. + */ + Response getLogAnalyticsLocationsWithResponse(String resourceGroupName, String profileName, + Context context); + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report. + */ + ContinentsResponse getLogAnalyticsLocations(String resourceGroupName, String profileName); + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response}. + */ + Response getLogAnalyticsResourcesWithResponse(String resourceGroupName, String profileName, + Context context); + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report. + */ + ResourcesResponse getLogAnalyticsResources(String resourceGroupName, String profileName); + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions The actions parameter. + * @param groupBy The groupBy parameter. + * @param ruleTypes The ruleTypes parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile along with {@link Response}. + */ + Response getWafLogAnalyticsMetricsWithResponse(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, WafGranularity granularity, + List actions, List groupBy, List ruleTypes, Context context); + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile. + */ + WafMetricsResponse getWafLogAnalyticsMetrics(String resourceGroupName, String profileName, List metrics, + OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, WafGranularity granularity); + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings The rankings parameter. + * @param actions The actions parameter. + * @param ruleTypes The ruleTypes parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wAF log analytics charts for AFD profile along with {@link Response}. + */ + Response getWafLogAnalyticsRankingsWithResponse(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, int maxRanking, + List rankings, List actions, List ruleTypes, Context context); + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics The metrics parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings The rankings 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 log analytics charts for AFD profile. + */ + WafRankingsResponse getWafLogAnalyticsRankings(String resourceGroupName, String profileName, + List metrics, OffsetDateTime dateTimeBegin, OffsetDateTime dateTimeEnd, int maxRanking, + List rankings); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetric.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetric.java new file mode 100644 index 000000000000..eb9de09f91dd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetric.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +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 a new instance of LogMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogMetric() { + } + + /** + * Creates or finds a LogMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogMetric. + */ + public static LogMetric fromString(String name) { + return fromString(name, LogMetric.class); + } + + /** + * Gets known LogMetric values. + * + * @return known LogMetric values. + */ + public static Collection values() { + return values(LogMetric.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGranularity.java new file mode 100644 index 000000000000..9db5c5c03b15 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGranularity.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import 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 a new instance of LogMetricsGranularity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogMetricsGranularity() { + } + + /** + * Creates or finds a LogMetricsGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogMetricsGranularity. + */ + public static LogMetricsGranularity fromString(String name) { + return fromString(name, LogMetricsGranularity.class); + } + + /** + * Gets known LogMetricsGranularity values. + * + * @return known LogMetricsGranularity values. + */ + public static Collection values() { + return values(LogMetricsGranularity.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGroupBy.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGroupBy.java new file mode 100644 index 000000000000..450b1b6a82b9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGroupBy.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for LogMetricsGroupBy. + */ +public final class LogMetricsGroupBy extends ExpandableStringEnum { + /** + * Static value httpStatusCode for LogMetricsGroupBy. + */ + public static final LogMetricsGroupBy HTTP_STATUS_CODE = fromString("httpStatusCode"); + + /** + * Static value protocol for LogMetricsGroupBy. + */ + public static final LogMetricsGroupBy PROTOCOL = fromString("protocol"); + + /** + * Static value cacheStatus for LogMetricsGroupBy. + */ + public static final LogMetricsGroupBy CACHE_STATUS = fromString("cacheStatus"); + + /** + * Static value countryOrRegion for LogMetricsGroupBy. + */ + public static final LogMetricsGroupBy COUNTRY_OR_REGION = fromString("countryOrRegion"); + + /** + * Static value customDomain for LogMetricsGroupBy. + */ + public static final LogMetricsGroupBy CUSTOM_DOMAIN = fromString("customDomain"); + + /** + * Creates a new instance of LogMetricsGroupBy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogMetricsGroupBy() { + } + + /** + * Creates or finds a LogMetricsGroupBy from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogMetricsGroupBy. + */ + public static LogMetricsGroupBy fromString(String name) { + return fromString(name, LogMetricsGroupBy.class); + } + + /** + * Gets known LogMetricsGroupBy values. + * + * @return known LogMetricsGroupBy values. + */ + public static Collection values() { + return values(LogMetricsGroupBy.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRanking.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRanking.java new file mode 100644 index 000000000000..46d60e4cedd2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRanking.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +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 a new instance of LogRanking value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogRanking() { + } + + /** + * Creates or finds a LogRanking from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogRanking. + */ + public static LogRanking fromString(String name) { + return fromString(name, LogRanking.class); + } + + /** + * Gets known LogRanking values. + * + * @return known LogRanking values. + */ + public static Collection values() { + return values(LogRanking.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRankingMetric.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRankingMetric.java new file mode 100644 index 000000000000..0e19818067eb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRankingMetric.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +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 a new instance of LogRankingMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogRankingMetric() { + } + + /** + * Creates or finds a LogRankingMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogRankingMetric. + */ + public static LogRankingMetric fromString(String name) { + return fromString(name, LogRankingMetric.class); + } + + /** + * Gets known LogRankingMetric values. + * + * @return known LogRankingMetric values. + */ + public static Collection values() { + return values(LogRankingMetric.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogSpecification.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogSpecification.java new file mode 100644 index 000000000000..6e2aed182c2e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogSpecification.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Log specification of operation. + */ +@Fluent +public final class LogSpecification implements JsonSerializable { + /* + * Name of log specification. + */ + private String name; + + /* + * Display name of log specification. + */ + private String displayName; + + /* + * Blob duration of specification. + */ + private String blobDuration; + + /* + * Pattern to filter based on name + */ + private String logFilterPattern; + + /** + * Creates an instance of LogSpecification class. + */ + public LogSpecification() { + } + + /** + * Get the name property: Name of log specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of log specification. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of log specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of log specification. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Blob duration of specification. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Blob duration of specification. + * + * @param blobDuration the blobDuration value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Get the logFilterPattern property: Pattern to filter based on name. + * + * @return the logFilterPattern value. + */ + public String logFilterPattern() { + return this.logFilterPattern; + } + + /** + * Set the logFilterPattern property: Pattern to filter based on name. + * + * @param logFilterPattern the logFilterPattern value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withLogFilterPattern(String logFilterPattern) { + this.logFilterPattern = logFilterPattern; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("blobDuration", this.blobDuration); + jsonWriter.writeStringField("logFilterPattern", this.logFilterPattern); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogSpecification. + */ + public static LogSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogSpecification deserializedLogSpecification = new LogSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLogSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedLogSpecification.displayName = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedLogSpecification.blobDuration = reader.getString(); + } else if ("logFilterPattern".equals(fieldName)) { + deserializedLogSpecification.logFilterPattern = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogSpecification; + }); + } +} 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 000000000000..12587f639fac --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificate.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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Managed Certificate used for https. + */ +@Fluent +public final class ManagedCertificate extends Certificate { + /* + * Certificate expiration date. + */ + private String expirationDate; + + /* + * Subject name in the certificate. + */ + private String subject; + + /** + * Creates an instance of ManagedCertificate class. + */ + public ManagedCertificate() { + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + @Override + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + @Override + public String subject() { + return this.subject; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedCertificate withType(SecretType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedCertificate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedCertificate. + */ + public static ManagedCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedCertificate deserializedManagedCertificate = new ManagedCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedCertificate.withType(SecretType.fromString(reader.getString())); + } else if ("subject".equals(fieldName)) { + deserializedManagedCertificate.subject = reader.getString(); + } else if ("expirationDate".equals(fieldName)) { + deserializedManagedCertificate.expirationDate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedCertificate; + }); + } +} 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 000000000000..dbfa239508c7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificateParameters.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Managed Certificate used for https. + */ +@Immutable +public final class ManagedCertificateParameters extends SecretParameters { + /* + * The type of the secret resource. + */ + private SecretType type = SecretType.MANAGED_CERTIFICATE; + + /* + * Subject name in the certificate. + */ + private String subject; + + /* + * Certificate expiration date. + */ + private String expirationDate; + + /** + * Creates an instance of ManagedCertificateParameters class. + */ + public ManagedCertificateParameters() { + } + + /** + * Get the type property: The type of the secret resource. + * + * @return the type value. + */ + @Override + public SecretType type() { + return this.type; + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedCertificateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedCertificateParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedCertificateParameters. + */ + public static ManagedCertificateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedCertificateParameters deserializedManagedCertificateParameters = new ManagedCertificateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedCertificateParameters.type = SecretType.fromString(reader.getString()); + } else if ("subject".equals(fieldName)) { + deserializedManagedCertificateParameters.subject = reader.getString(); + } else if ("expirationDate".equals(fieldName)) { + deserializedManagedCertificateParameters.expirationDate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedCertificateParameters; + }); + } +} 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 000000000000..83a200a77e7e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleDefinition.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a managed rule definition. + */ +@Immutable +public final class ManagedRuleDefinition implements JsonSerializable { + /* + * Identifier for the managed rule. + */ + private String ruleId; + + /* + * Describes the functionality of the managed rule. + */ + private String description; + + /** + * Creates an instance of ManagedRuleDefinition class. + */ + public ManagedRuleDefinition() { + } + + /** + * Get the ruleId property: Identifier for the managed rule. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Get the description property: Describes the functionality of the managed rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedRuleDefinition. + */ + public static ManagedRuleDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleDefinition deserializedManagedRuleDefinition = new ManagedRuleDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleId".equals(fieldName)) { + deserializedManagedRuleDefinition.ruleId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedManagedRuleDefinition.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleDefinition; + }); + } +} 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 000000000000..638528f8dbb8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleEnabledState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. + */ +public final class ManagedRuleEnabledState extends ExpandableStringEnum { + /** + * Static value Disabled for ManagedRuleEnabledState. + */ + public static final ManagedRuleEnabledState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for ManagedRuleEnabledState. + */ + public static final ManagedRuleEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of ManagedRuleEnabledState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedRuleEnabledState() { + } + + /** + * Creates or finds a ManagedRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedRuleEnabledState. + */ + public static ManagedRuleEnabledState fromString(String name) { + return fromString(name, ManagedRuleEnabledState.class); + } + + /** + * Gets known ManagedRuleEnabledState values. + * + * @return known ManagedRuleEnabledState values. + */ + public static Collection values() { + return values(ManagedRuleEnabledState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupDefinition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupDefinition.java new file mode 100644 index 000000000000..bf4a419cb746 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupDefinition.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a managed rule group. + */ +@Immutable +public final class ManagedRuleGroupDefinition implements JsonSerializable { + /* + * Name of the managed rule group. + */ + private String ruleGroupName; + + /* + * Description of the managed rule group. + */ + private String description; + + /* + * List of rules within the managed rule group. + */ + private List rules; + + /** + * Creates an instance of ManagedRuleGroupDefinition class. + */ + public ManagedRuleGroupDefinition() { + } + + /** + * Get the ruleGroupName property: Name of the managed rule group. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Get the description property: Description of the managed rule group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the rules property: List of rules within the managed rule group. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleGroupDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleGroupDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedRuleGroupDefinition. + */ + public static ManagedRuleGroupDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleGroupDefinition deserializedManagedRuleGroupDefinition = new ManagedRuleGroupDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleGroupName".equals(fieldName)) { + deserializedManagedRuleGroupDefinition.ruleGroupName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedManagedRuleGroupDefinition.description = reader.getString(); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> ManagedRuleDefinition.fromJson(reader1)); + deserializedManagedRuleGroupDefinition.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleGroupDefinition; + }); + } +} 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 000000000000..0e299af8f58d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupOverride.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines a managed rule group override setting. + */ +@Fluent +public final class ManagedRuleGroupOverride implements JsonSerializable { + /* + * Describes the managed rule group within the rule set to override + */ + private String ruleGroupName; + + /* + * List of rules that will be enabled. If none specified, all rules in the group will be disabled. + */ + private List rules; + + /** + * Creates an instance of ManagedRuleGroupOverride class. + */ + public ManagedRuleGroupOverride() { + } + + /** + * Get the ruleGroupName property: Describes the managed rule group within the rule set to override. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: Describes the managed rule group within the rule set to override. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the rules property: List of rules that will be enabled. If none specified, all rules in the group will be + * disabled. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules that will be enabled. If none specified, all rules in the group will be + * disabled. + * + * @param rules the rules value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroupName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleGroupName in model ManagedRuleGroupOverride")); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleGroupOverride.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleGroupName", this.ruleGroupName); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleGroupOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleGroupOverride if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedRuleGroupOverride. + */ + public static ManagedRuleGroupOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleGroupOverride deserializedManagedRuleGroupOverride = new ManagedRuleGroupOverride(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleGroupName".equals(fieldName)) { + deserializedManagedRuleGroupOverride.ruleGroupName = reader.getString(); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> ManagedRuleOverride.fromJson(reader1)); + deserializedManagedRuleGroupOverride.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleGroupOverride; + }); + } +} 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 000000000000..1d1d12649274 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleOverride.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines a managed rule group override setting. + */ +@Fluent +public final class ManagedRuleOverride implements JsonSerializable { + /* + * Identifier for the managed rule. + */ + private String ruleId; + + /* + * Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. + */ + private ManagedRuleEnabledState enabledState; + + /* + * Describes the override action to be applied when rule matches. + */ + private ActionType action; + + /** + * Creates an instance of ManagedRuleOverride class. + */ + public ManagedRuleOverride() { + } + + /** + * Get the ruleId property: Identifier for the managed rule. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: Identifier for the managed rule. + * + * @param ruleId the ruleId value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the enabledState property: Describes if the managed rule is in enabled or disabled state. Defaults to + * Disabled if not specified. + * + * @return the enabledState value. + */ + public ManagedRuleEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Describes if the managed rule is in enabled or disabled state. Defaults to + * Disabled if not specified. + * + * @param enabledState the enabledState value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withEnabledState(ManagedRuleEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the action property: Describes the override action to be applied when rule matches. + * + * @return the action value. + */ + public ActionType action() { + return this.action; + } + + /** + * Set the action property: Describes the override action to be applied when rule matches. + * + * @param action the action value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withAction(ActionType action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ruleId in model ManagedRuleOverride")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleOverride.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleId", this.ruleId); + jsonWriter.writeStringField("enabledState", this.enabledState == null ? null : this.enabledState.toString()); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleOverride if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedRuleOverride. + */ + public static ManagedRuleOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleOverride deserializedManagedRuleOverride = new ManagedRuleOverride(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleId".equals(fieldName)) { + deserializedManagedRuleOverride.ruleId = reader.getString(); + } else if ("enabledState".equals(fieldName)) { + deserializedManagedRuleOverride.enabledState + = ManagedRuleEnabledState.fromString(reader.getString()); + } else if ("action".equals(fieldName)) { + deserializedManagedRuleOverride.action = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleOverride; + }); + } +} 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 000000000000..b30bde9b95ac --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSet.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines a managed rule set. + */ +@Fluent +public final class ManagedRuleSet implements JsonSerializable { + /* + * Defines the rule set type to use. + */ + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + private String ruleSetVersion; + + /* + * Verizon only : If the rule set supports anomaly detection mode, this describes the threshold for blocking + * requests. + */ + private Integer anomalyScore; + + /* + * Defines the rule overrides to apply to the rule set. + */ + private List ruleGroupOverrides; + + /** + * Creates an instance of ManagedRuleSet class. + */ + public ManagedRuleSet() { + } + + /** + * Get the ruleSetType property: Defines the rule set type to use. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the ruleSetType property: Defines the rule set type to use. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the ruleSetVersion property: Defines the version of the rule set to use. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the ruleSetVersion property: Defines the version of the rule set to use. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the anomalyScore property: Verizon only : If the rule set supports anomaly detection mode, this describes the + * threshold for blocking requests. + * + * @return the anomalyScore value. + */ + public Integer anomalyScore() { + return this.anomalyScore; + } + + /** + * Set the anomalyScore property: Verizon only : If the rule set supports anomaly detection mode, this describes the + * threshold for blocking requests. + * + * @param anomalyScore the anomalyScore value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withAnomalyScore(Integer anomalyScore) { + this.anomalyScore = anomalyScore; + return this; + } + + /** + * Get the ruleGroupOverrides property: Defines the rule overrides to apply to the rule set. + * + * @return the ruleGroupOverrides value. + */ + public List ruleGroupOverrides() { + return this.ruleGroupOverrides; + } + + /** + * Set the ruleGroupOverrides property: Defines the rule overrides to apply to the rule set. + * + * @param ruleGroupOverrides the ruleGroupOverrides value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleGroupOverrides(List ruleGroupOverrides) { + this.ruleGroupOverrides = ruleGroupOverrides; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleSetType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ruleSetType in model ManagedRuleSet")); + } + if (ruleSetVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ruleSetVersion in model ManagedRuleSet")); + } + if (ruleGroupOverrides() != null) { + ruleGroupOverrides().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleSet.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleSetType", this.ruleSetType); + jsonWriter.writeStringField("ruleSetVersion", this.ruleSetVersion); + jsonWriter.writeNumberField("anomalyScore", this.anomalyScore); + jsonWriter.writeArrayField("ruleGroupOverrides", this.ruleGroupOverrides, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleSet if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedRuleSet. + */ + public static ManagedRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleSet deserializedManagedRuleSet = new ManagedRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleSetType".equals(fieldName)) { + deserializedManagedRuleSet.ruleSetType = reader.getString(); + } else if ("ruleSetVersion".equals(fieldName)) { + deserializedManagedRuleSet.ruleSetVersion = reader.getString(); + } else if ("anomalyScore".equals(fieldName)) { + deserializedManagedRuleSet.anomalyScore = reader.getNullable(JsonReader::getInt); + } else if ("ruleGroupOverrides".equals(fieldName)) { + List ruleGroupOverrides + = reader.readArray(reader1 -> ManagedRuleGroupOverride.fromJson(reader1)); + deserializedManagedRuleSet.ruleGroupOverrides = ruleGroupOverrides; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleSet; + }); + } +} 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 000000000000..d0a98e025d92 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinition.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.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import java.util.List; + +/** + * An immutable client-side representation of ManagedRuleSetDefinition. + */ +public interface ManagedRuleSetDefinition { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the managed rule set. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the ruleSetType property: Type of the managed rule set. + * + * @return the ruleSetType value. + */ + String ruleSetType(); + + /** + * Gets the ruleSetVersion property: Version of the managed rule set type. + * + * @return the ruleSetVersion value. + */ + String ruleSetVersion(); + + /** + * Gets the ruleGroups property: Rule groups of the managed rule set. + * + * @return the ruleGroups value. + */ + List ruleGroups(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner object. + * + * @return the inner object. + */ + ManagedRuleSetDefinitionInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinitionList.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinitionList.java new file mode 100644 index 000000000000..9368f1f69ffa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinitionList.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import java.io.IOException; +import java.util.List; + +/** + * List of managed rule set definitions available for use in a policy. + */ +@Fluent +public final class ManagedRuleSetDefinitionList implements JsonSerializable { + /* + * List of managed rule set definitions. + */ + private List value; + + /* + * URL to retrieve next set of managed rule set definitions. + */ + private String nextLink; + + /** + * Creates an instance of ManagedRuleSetDefinitionList class. + */ + public ManagedRuleSetDefinitionList() { + } + + /** + * Get the value property: List of managed rule set definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to retrieve next set of managed rule set definitions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to retrieve next set of managed rule set definitions. + * + * @param nextLink the nextLink value to set. + * @return the ManagedRuleSetDefinitionList object itself. + */ + public ManagedRuleSetDefinitionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleSetDefinitionList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleSetDefinitionList if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedRuleSetDefinitionList. + */ + public static ManagedRuleSetDefinitionList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleSetDefinitionList deserializedManagedRuleSetDefinitionList = new ManagedRuleSetDefinitionList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ManagedRuleSetDefinitionInner.fromJson(reader1)); + deserializedManagedRuleSetDefinitionList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedManagedRuleSetDefinitionList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleSetDefinitionList; + }); + } +} 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 000000000000..5812665b2a28 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetList.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the list of managed rule sets for the policy. + */ +@Fluent +public final class ManagedRuleSetList implements JsonSerializable { + /* + * List of rule sets. + */ + private List managedRuleSets; + + /** + * Creates an instance of ManagedRuleSetList class. + */ + public ManagedRuleSetList() { + } + + /** + * Get the managedRuleSets property: List of rule sets. + * + * @return the managedRuleSets value. + */ + public List managedRuleSets() { + return this.managedRuleSets; + } + + /** + * Set the managedRuleSets property: List of rule sets. + * + * @param managedRuleSets the managedRuleSets value to set. + * @return the ManagedRuleSetList object itself. + */ + public ManagedRuleSetList withManagedRuleSets(List managedRuleSets) { + this.managedRuleSets = managedRuleSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedRuleSets() != null) { + managedRuleSets().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("managedRuleSets", this.managedRuleSets, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleSetList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleSetList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedRuleSetList. + */ + public static ManagedRuleSetList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleSetList deserializedManagedRuleSetList = new ManagedRuleSetList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managedRuleSets".equals(fieldName)) { + List managedRuleSets + = reader.readArray(reader1 -> ManagedRuleSet.fromJson(reader1)); + deserializedManagedRuleSetList.managedRuleSets = managedRuleSets; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleSetList; + }); + } +} 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 000000000000..a61334e20997 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSets.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.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedRuleSets. + */ +public interface ManagedRuleSets { + /** + * Lists all available managed rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all available managed rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..c20d72e8375b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentity.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentityType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..38e4b8c7681c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned, UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchCondition.java new file mode 100644 index 000000000000..d131e92a7270 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchCondition.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Define match conditions. + */ +@Fluent +public final class MatchCondition implements JsonSerializable { + /* + * Match variable to compare against. + */ + private WafMatchVariable matchVariable; + + /* + * Selector can used to match a specific key for QueryString, Cookies, RequestHeader or PostArgs. + */ + private String selector; + + /* + * Describes operator to be matched + */ + private Operator operator; + + /* + * Describes if the result of this condition should be negated. + */ + private Boolean negateCondition; + + /* + * List of possible match values. + */ + private List matchValue; + + /* + * List of transforms. + */ + private List transforms; + + /** + * Creates an instance of MatchCondition class. + */ + public MatchCondition() { + } + + /** + * Get the matchVariable property: Match variable to compare against. + * + * @return the matchVariable value. + */ + public WafMatchVariable matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: Match variable to compare against. + * + * @param matchVariable the matchVariable value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchVariable(WafMatchVariable matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get the selector property: Selector can used to match a specific key for QueryString, Cookies, RequestHeader or + * PostArgs. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: Selector can used to match a specific key for QueryString, Cookies, RequestHeader or + * PostArgs. + * + * @param selector the selector value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public Operator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withOperator(Operator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if the result of this condition should be negated. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if the result of this condition should be negated. + * + * @param negateCondition the negateCondition value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValue property: List of possible match values. + * + * @return the matchValue value. + */ + public List matchValue() { + return this.matchValue; + } + + /** + * Set the matchValue property: List of possible match values. + * + * @param matchValue the matchValue value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchValue(List matchValue) { + this.matchValue = matchValue; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property matchVariable in model MatchCondition")); + } + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property operator in model MatchCondition")); + } + if (matchValue() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property matchValue in model MatchCondition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MatchCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("matchVariable", this.matchVariable == null ? null : this.matchVariable.toString()); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeArrayField("matchValue", this.matchValue, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("selector", this.selector); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MatchCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MatchCondition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MatchCondition. + */ + public static MatchCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MatchCondition deserializedMatchCondition = new MatchCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("matchVariable".equals(fieldName)) { + deserializedMatchCondition.matchVariable = WafMatchVariable.fromString(reader.getString()); + } else if ("operator".equals(fieldName)) { + deserializedMatchCondition.operator = Operator.fromString(reader.getString()); + } else if ("matchValue".equals(fieldName)) { + List matchValue = reader.readArray(reader1 -> reader1.getString()); + deserializedMatchCondition.matchValue = matchValue; + } else if ("selector".equals(fieldName)) { + deserializedMatchCondition.selector = reader.getString(); + } else if ("negateCondition".equals(fieldName)) { + deserializedMatchCondition.negateCondition = reader.getNullable(JsonReader::getBoolean); + } else if ("transforms".equals(fieldName)) { + List transforms + = reader.readArray(reader1 -> TransformType.fromString(reader1.getString())); + deserializedMatchCondition.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedMatchCondition; + }); + } +} 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 000000000000..cf84ba4b4c06 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchProcessingBehavior.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 java.util.Collection; + +/** + * If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, + * defaults to Continue. + */ +public final class MatchProcessingBehavior extends ExpandableStringEnum { + /** + * Static value Continue for MatchProcessingBehavior. + */ + public static final MatchProcessingBehavior CONTINUE = fromString("Continue"); + + /** + * Static value Stop for MatchProcessingBehavior. + */ + public static final MatchProcessingBehavior STOP = fromString("Stop"); + + /** + * Creates a new instance of MatchProcessingBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MatchProcessingBehavior() { + } + + /** + * Creates or finds a MatchProcessingBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding MatchProcessingBehavior. + */ + public static MatchProcessingBehavior fromString(String name) { + return fromString(name, MatchProcessingBehavior.class); + } + + /** + * Gets known MatchProcessingBehavior values. + * + * @return known MatchProcessingBehavior values. + */ + public static Collection values() { + return values(MatchProcessingBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchVariable.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchVariable.java new file mode 100644 index 000000000000..c92138f90750 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchVariable.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The name of the condition for the delivery rule. + */ +public final class MatchVariable extends ExpandableStringEnum { + /** + * Static value RemoteAddress for MatchVariable. + */ + public static final MatchVariable REMOTE_ADDRESS = fromString("RemoteAddress"); + + /** + * Static value RequestMethod for MatchVariable. + */ + public static final MatchVariable REQUEST_METHOD = fromString("RequestMethod"); + + /** + * Static value QueryString for MatchVariable. + */ + public static final MatchVariable QUERY_STRING = fromString("QueryString"); + + /** + * Static value PostArgs for MatchVariable. + */ + public static final MatchVariable POST_ARGS = fromString("PostArgs"); + + /** + * Static value RequestUri for MatchVariable. + */ + public static final MatchVariable REQUEST_URI = fromString("RequestUri"); + + /** + * Static value RequestHeader for MatchVariable. + */ + public static final MatchVariable REQUEST_HEADER = fromString("RequestHeader"); + + /** + * Static value RequestBody for MatchVariable. + */ + public static final MatchVariable REQUEST_BODY = fromString("RequestBody"); + + /** + * Static value RequestScheme for MatchVariable. + */ + public static final MatchVariable REQUEST_SCHEME = fromString("RequestScheme"); + + /** + * Static value UrlPath for MatchVariable. + */ + public static final MatchVariable URL_PATH = fromString("UrlPath"); + + /** + * Static value UrlFileExtension for MatchVariable. + */ + public static final MatchVariable URL_FILE_EXTENSION = fromString("UrlFileExtension"); + + /** + * Static value UrlFileName for MatchVariable. + */ + public static final MatchVariable URL_FILE_NAME = fromString("UrlFileName"); + + /** + * Static value HttpVersion for MatchVariable. + */ + public static final MatchVariable HTTP_VERSION = fromString("HttpVersion"); + + /** + * Static value Cookies for MatchVariable. + */ + public static final MatchVariable COOKIES = fromString("Cookies"); + + /** + * Static value IsDevice for MatchVariable. + */ + public static final MatchVariable IS_DEVICE = fromString("IsDevice"); + + /** + * Static value SocketAddr for MatchVariable. + */ + public static final MatchVariable SOCKET_ADDR = fromString("SocketAddr"); + + /** + * Static value ClientPort for MatchVariable. + */ + public static final MatchVariable CLIENT_PORT = fromString("ClientPort"); + + /** + * Static value ServerPort for MatchVariable. + */ + public static final MatchVariable SERVER_PORT = fromString("ServerPort"); + + /** + * Static value HostName for MatchVariable. + */ + public static final MatchVariable HOST_NAME = fromString("HostName"); + + /** + * Static value SslProtocol for MatchVariable. + */ + public static final MatchVariable SSL_PROTOCOL = fromString("SslProtocol"); + + /** + * Creates a new instance of MatchVariable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MatchVariable() { + } + + /** + * Creates or finds a MatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding MatchVariable. + */ + public static MatchVariable fromString(String name) { + return fromString(name, MatchVariable.class); + } + + /** + * Gets known MatchVariable values. + * + * @return known MatchVariable values. + */ + public static Collection values() { + return values(MatchVariable.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricAvailability.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricAvailability.java new file mode 100644 index 000000000000..cfbbb382e285 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricAvailability.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Retention policy of a resource metric. + */ +@Fluent +public final class MetricAvailability implements JsonSerializable { + /* + * The timeGrain property. + */ + private String timeGrain; + + /* + * The blobDuration property. + */ + private String blobDuration; + + /** + * Creates an instance of MetricAvailability class. + */ + public MetricAvailability() { + } + + /** + * Get the timeGrain property: The timeGrain property. + * + * @return the timeGrain value. + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set the timeGrain property: The timeGrain property. + * + * @param timeGrain the timeGrain value to set. + * @return the MetricAvailability object itself. + */ + public MetricAvailability withTimeGrain(String timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the blobDuration property: The blobDuration property. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: The blobDuration property. + * + * @param blobDuration the blobDuration value to set. + * @return the MetricAvailability object itself. + */ + public MetricAvailability withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeGrain", this.timeGrain); + jsonWriter.writeStringField("blobDuration", this.blobDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricAvailability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricAvailability if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricAvailability. + */ + public static MetricAvailability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricAvailability deserializedMetricAvailability = new MetricAvailability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeGrain".equals(fieldName)) { + deserializedMetricAvailability.timeGrain = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedMetricAvailability.blobDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricAvailability; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricSpecification.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricSpecification.java new file mode 100644 index 000000000000..e3a4a2c4f6f2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricSpecification.java @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Metric specification of operation. + */ +@Fluent +public final class MetricSpecification implements JsonSerializable { + /* + * Name of metric specification. + */ + private String name; + + /* + * Display name of metric specification. + */ + private String displayName; + + /* + * Display description of metric specification. + */ + private String displayDescription; + + /* + * The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + */ + private String unit; + + /* + * The metric aggregation type. Possible values include: 'Average', 'Count', 'Total'. + */ + private String aggregationType; + + /* + * Retention policies of a resource metric. + */ + private List availabilities; + + /* + * The supported time grain types for the metrics. + */ + private List supportedTimeGrainTypes; + + /* + * The dimensions of metric + */ + private List dimensions; + + /* + * Property to specify whether to fill gap with zero. + */ + private Boolean fillGapWithZero; + + /* + * Pattern to filter based on name + */ + private String metricFilterPattern; + + /* + * Property to specify metric is internal or not. + */ + private Boolean isInternal; + + /** + * Creates an instance of MetricSpecification class. + */ + public MetricSpecification() { + } + + /** + * Get the name property: Name of metric specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of metric specification. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of metric specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of metric specification. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Display description of metric specification. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Display description of metric specification. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', + * 'Total'. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', + * 'Total'. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the availabilities property: Retention policies of a resource metric. + * + * @return the availabilities value. + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set the availabilities property: Retention policies of a resource metric. + * + * @param availabilities the availabilities value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAvailabilities(List availabilities) { + this.availabilities = availabilities; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: The supported time grain types for the metrics. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: The supported time grain types for the metrics. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the dimensions property: The dimensions of metric. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The dimensions of metric. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the fillGapWithZero property: Property to specify whether to fill gap with zero. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Property to specify whether to fill gap with zero. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the metricFilterPattern property: Pattern to filter based on name. + * + * @return the metricFilterPattern value. + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set the metricFilterPattern property: Pattern to filter based on name. + * + * @param metricFilterPattern the metricFilterPattern value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { + this.metricFilterPattern = metricFilterPattern; + return this; + } + + /** + * Get the isInternal property: Property to specify metric is internal or not. + * + * @return the isInternal value. + */ + public Boolean isInternal() { + return this.isInternal; + } + + /** + * Set the isInternal property: Property to specify metric is internal or not. + * + * @param isInternal the isInternal value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withIsInternal(Boolean isInternal) { + this.isInternal = isInternal; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilities() != null) { + availabilities().forEach(e -> e.validate()); + } + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("displayDescription", this.displayDescription); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeStringField("aggregationType", this.aggregationType); + jsonWriter.writeArrayField("availabilities", this.availabilities, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("supportedTimeGrainTypes", this.supportedTimeGrainTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("fillGapWithZero", this.fillGapWithZero); + jsonWriter.writeStringField("metricFilterPattern", this.metricFilterPattern); + jsonWriter.writeBooleanField("isInternal", this.isInternal); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricSpecification. + */ + public static MetricSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricSpecification deserializedMetricSpecification = new MetricSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMetricSpecification.displayName = reader.getString(); + } else if ("displayDescription".equals(fieldName)) { + deserializedMetricSpecification.displayDescription = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricSpecification.unit = reader.getString(); + } else if ("aggregationType".equals(fieldName)) { + deserializedMetricSpecification.aggregationType = reader.getString(); + } else if ("availabilities".equals(fieldName)) { + List availabilities + = reader.readArray(reader1 -> MetricAvailability.fromJson(reader1)); + deserializedMetricSpecification.availabilities = availabilities; + } else if ("supportedTimeGrainTypes".equals(fieldName)) { + List supportedTimeGrainTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricSpecification.supportedTimeGrainTypes = supportedTimeGrainTypes; + } else if ("dimensions".equals(fieldName)) { + List dimensions + = reader.readArray(reader1 -> DimensionProperties.fromJson(reader1)); + deserializedMetricSpecification.dimensions = dimensions; + } else if ("fillGapWithZero".equals(fieldName)) { + deserializedMetricSpecification.fillGapWithZero = reader.getNullable(JsonReader::getBoolean); + } else if ("metricFilterPattern".equals(fieldName)) { + deserializedMetricSpecification.metricFilterPattern = reader.getString(); + } else if ("isInternal".equals(fieldName)) { + deserializedMetricSpecification.isInternal = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricSpecification; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsGranularity.java new file mode 100644 index 000000000000..1bdae494b1e1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsGranularity.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for MetricsGranularity. + */ +public final class MetricsGranularity extends ExpandableStringEnum { + /** + * Static value PT5M for MetricsGranularity. + */ + public static final MetricsGranularity PT5M = fromString("PT5M"); + + /** + * Static value PT1H for MetricsGranularity. + */ + public static final MetricsGranularity PT1H = fromString("PT1H"); + + /** + * Static value P1D for MetricsGranularity. + */ + public static final MetricsGranularity P1D = fromString("P1D"); + + /** + * Creates a new instance of MetricsGranularity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetricsGranularity() { + } + + /** + * Creates or finds a MetricsGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricsGranularity. + */ + public static MetricsGranularity fromString(String name) { + return fromString(name, MetricsGranularity.class); + } + + /** + * Gets known MetricsGranularity values. + * + * @return known MetricsGranularity values. + */ + public static Collection values() { + return values(MetricsGranularity.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponse.java new file mode 100644 index 000000000000..cdb845a4c4fb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponse.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of MetricsResponse. + */ +public interface MetricsResponse { + /** + * Gets the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + OffsetDateTime dateTimeBegin(); + + /** + * Gets the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + OffsetDateTime dateTimeEnd(); + + /** + * Gets the granularity property: The granularity property. + * + * @return the granularity value. + */ + MetricsGranularity granularity(); + + /** + * Gets the series property: The series property. + * + * @return the series value. + */ + List series(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner object. + * + * @return the inner object. + */ + MetricsResponseInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItem.java new file mode 100644 index 000000000000..1a71907619fd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItem.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The MetricsResponseSeriesItem model. + */ +@Fluent +public final class MetricsResponseSeriesItem implements JsonSerializable { + /* + * The metric property. + */ + private String metric; + + /* + * The unit property. + */ + private MetricsSeriesUnit unit; + + /* + * The groups property. + */ + private List groups; + + /* + * The data property. + */ + private List data; + + /** + * Creates an instance of MetricsResponseSeriesItem class. + */ + public MetricsResponseSeriesItem() { + } + + /** + * Get the metric property: The metric property. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: The metric property. + * + * @param metric the metric value to set. + * @return the MetricsResponseSeriesItem object itself. + */ + public MetricsResponseSeriesItem withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the unit property: The unit property. + * + * @return the unit value. + */ + public MetricsSeriesUnit unit() { + return this.unit; + } + + /** + * Set the unit property: The unit property. + * + * @param unit the unit value to set. + * @return the MetricsResponseSeriesItem object itself. + */ + public MetricsResponseSeriesItem withUnit(MetricsSeriesUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the groups property: The groups property. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The groups property. + * + * @param groups the groups value to set. + * @return the MetricsResponseSeriesItem object itself. + */ + public MetricsResponseSeriesItem withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the data property: The data property. + * + * @return the data value. + */ + public List data() { + return this.data; + } + + /** + * Set the data property: The data property. + * + * @param data the data value to set. + * @return the MetricsResponseSeriesItem object itself. + */ + public MetricsResponseSeriesItem withData(List data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + if (data() != null) { + data().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metric", this.metric); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + jsonWriter.writeArrayField("groups", this.groups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsResponseSeriesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsResponseSeriesItem if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricsResponseSeriesItem. + */ + public static MetricsResponseSeriesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsResponseSeriesItem deserializedMetricsResponseSeriesItem = new MetricsResponseSeriesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metric".equals(fieldName)) { + deserializedMetricsResponseSeriesItem.metric = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricsResponseSeriesItem.unit = MetricsSeriesUnit.fromString(reader.getString()); + } else if ("groups".equals(fieldName)) { + List groups + = reader.readArray(reader1 -> MetricsResponseSeriesPropertiesItemsItem.fromJson(reader1)); + deserializedMetricsResponseSeriesItem.groups = groups; + } else if ("data".equals(fieldName)) { + List data + = reader.readArray(reader1 -> MetricsResponseSeriesItemData.fromJson(reader1)); + deserializedMetricsResponseSeriesItem.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsResponseSeriesItem; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemData.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemData.java new file mode 100644 index 000000000000..a7288036942b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemData.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The MetricsResponseSeriesItemData model. + */ +@Fluent +public final class MetricsResponseSeriesItemData implements JsonSerializable { + /* + * The dateTime property. + */ + private OffsetDateTime dateTime; + + /* + * The value property. + */ + private Float value; + + /** + * Creates an instance of MetricsResponseSeriesItemData class. + */ + public MetricsResponseSeriesItemData() { + } + + /** + * Get the dateTime property: The dateTime property. + * + * @return the dateTime value. + */ + public OffsetDateTime dateTime() { + return this.dateTime; + } + + /** + * Set the dateTime property: The dateTime property. + * + * @param dateTime the dateTime value to set. + * @return the MetricsResponseSeriesItemData object itself. + */ + public MetricsResponseSeriesItemData withDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public Float value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the MetricsResponseSeriesItemData object itself. + */ + public MetricsResponseSeriesItemData withValue(Float value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dateTime", + this.dateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTime)); + jsonWriter.writeNumberField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsResponseSeriesItemData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsResponseSeriesItemData if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricsResponseSeriesItemData. + */ + public static MetricsResponseSeriesItemData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsResponseSeriesItemData deserializedMetricsResponseSeriesItemData + = new MetricsResponseSeriesItemData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dateTime".equals(fieldName)) { + deserializedMetricsResponseSeriesItemData.dateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("value".equals(fieldName)) { + deserializedMetricsResponseSeriesItemData.value = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsResponseSeriesItemData; + }); + } +} 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 000000000000..d9cbaf967bd4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesPropertiesItemsItem.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MetricsResponseSeriesPropertiesItemsItem model. + */ +@Fluent +public final class MetricsResponseSeriesPropertiesItemsItem + implements JsonSerializable { + /* + * The name property. + */ + private String name; + + /* + * The value property. + */ + private String value; + + /** + * Creates an instance of MetricsResponseSeriesPropertiesItemsItem class. + */ + public MetricsResponseSeriesPropertiesItemsItem() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the MetricsResponseSeriesPropertiesItemsItem object itself. + */ + public MetricsResponseSeriesPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the MetricsResponseSeriesPropertiesItemsItem object itself. + */ + public MetricsResponseSeriesPropertiesItemsItem withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsResponseSeriesPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsResponseSeriesPropertiesItemsItem if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricsResponseSeriesPropertiesItemsItem. + */ + public static MetricsResponseSeriesPropertiesItemsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsResponseSeriesPropertiesItemsItem deserializedMetricsResponseSeriesPropertiesItemsItem + = new MetricsResponseSeriesPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricsResponseSeriesPropertiesItemsItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedMetricsResponseSeriesPropertiesItemsItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsResponseSeriesPropertiesItemsItem; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsSeriesUnit.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsSeriesUnit.java new file mode 100644 index 000000000000..c91756a6e6fb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsSeriesUnit.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 java.util.Collection; + +/** + * Defines values for MetricsSeriesUnit. + */ +public final class MetricsSeriesUnit extends ExpandableStringEnum { + /** + * Static value count for MetricsSeriesUnit. + */ + public static final MetricsSeriesUnit COUNT = fromString("count"); + + /** + * Static value bytes for MetricsSeriesUnit. + */ + public static final MetricsSeriesUnit BYTES = fromString("bytes"); + + /** + * Static value bitsPerSecond for MetricsSeriesUnit. + */ + public static final MetricsSeriesUnit BITS_PER_SECOND = fromString("bitsPerSecond"); + + /** + * Static value milliSeconds for MetricsSeriesUnit. + */ + public static final MetricsSeriesUnit MILLI_SECONDS = fromString("milliSeconds"); + + /** + * Creates a new instance of MetricsSeriesUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetricsSeriesUnit() { + } + + /** + * Creates or finds a MetricsSeriesUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricsSeriesUnit. + */ + public static MetricsSeriesUnit fromString(String name) { + return fromString(name, MetricsSeriesUnit.class); + } + + /** + * Gets known MetricsSeriesUnit values. + * + * @return known MetricsSeriesUnit values. + */ + public static Collection values() { + return values(MetricsSeriesUnit.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrateResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrateResult.java new file mode 100644 index 000000000000..8d11a5574d9b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrateResult.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.MigrateResultInner; + +/** + * An immutable client-side representation of MigrateResult. + */ +public interface MigrateResult { + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the migratedProfileResourceId property: Arm resource id of the migrated profile. + * + * @return the migratedProfileResourceId value. + */ + ResourceReference migratedProfileResourceId(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner object. + * + * @return the inner object. + */ + MigrateResultInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationEndpointMapping.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationEndpointMapping.java new file mode 100644 index 000000000000..b0b60ffa6e9f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationEndpointMapping.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * CDN Endpoint Mapping. + */ +@Fluent +public final class MigrationEndpointMapping implements JsonSerializable { + /* + * Name of the classic CDN profile endpoint. + */ + private String migratedFrom; + + /* + * Name of the newly created migrated Azure Frontdoor Standard/Premium profile endpoint. This name will replace the + * name of the classic CDN endpoint resource. + */ + private String migratedTo; + + /** + * Creates an instance of MigrationEndpointMapping class. + */ + public MigrationEndpointMapping() { + } + + /** + * Get the migratedFrom property: Name of the classic CDN profile endpoint. + * + * @return the migratedFrom value. + */ + public String migratedFrom() { + return this.migratedFrom; + } + + /** + * Set the migratedFrom property: Name of the classic CDN profile endpoint. + * + * @param migratedFrom the migratedFrom value to set. + * @return the MigrationEndpointMapping object itself. + */ + public MigrationEndpointMapping withMigratedFrom(String migratedFrom) { + this.migratedFrom = migratedFrom; + return this; + } + + /** + * Get the migratedTo property: Name of the newly created migrated Azure Frontdoor Standard/Premium profile + * endpoint. This name will replace the name of the classic CDN endpoint resource. + * + * @return the migratedTo value. + */ + public String migratedTo() { + return this.migratedTo; + } + + /** + * Set the migratedTo property: Name of the newly created migrated Azure Frontdoor Standard/Premium profile + * endpoint. This name will replace the name of the classic CDN endpoint resource. + * + * @param migratedTo the migratedTo value to set. + * @return the MigrationEndpointMapping object itself. + */ + public MigrationEndpointMapping withMigratedTo(String migratedTo) { + this.migratedTo = migratedTo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("migratedFrom", this.migratedFrom); + jsonWriter.writeStringField("migratedTo", this.migratedTo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationEndpointMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationEndpointMapping if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationEndpointMapping. + */ + public static MigrationEndpointMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationEndpointMapping deserializedMigrationEndpointMapping = new MigrationEndpointMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migratedFrom".equals(fieldName)) { + deserializedMigrationEndpointMapping.migratedFrom = reader.getString(); + } else if ("migratedTo".equals(fieldName)) { + deserializedMigrationEndpointMapping.migratedTo = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationEndpointMapping; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationErrorType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationErrorType.java new file mode 100644 index 000000000000..9b98c9dd704e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationErrorType.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Error response indicates CDN service is not able to process the incoming request. The reason is provided in the error + * message. + */ +@Immutable +public final class MigrationErrorType implements JsonSerializable { + /* + * Error code. + */ + private String code; + + /* + * Resource which has the problem. + */ + private String resourceName; + + /* + * Error message indicating why the operation failed. + */ + private String errorMessage; + + /* + * Describes what needs to be done to fix the problem + */ + private String nextSteps; + + /** + * Creates an instance of MigrationErrorType class. + */ + public MigrationErrorType() { + } + + /** + * Get the code property: Error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the resourceName property: Resource which has the problem. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Get the errorMessage property: Error message indicating why the operation failed. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the nextSteps property: Describes what needs to be done to fix the problem. + * + * @return the nextSteps value. + */ + public String nextSteps() { + return this.nextSteps; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationErrorType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationErrorType if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationErrorType. + */ + public static MigrationErrorType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationErrorType deserializedMigrationErrorType = new MigrationErrorType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedMigrationErrorType.code = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedMigrationErrorType.resourceName = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedMigrationErrorType.errorMessage = reader.getString(); + } else if ("nextSteps".equals(fieldName)) { + deserializedMigrationErrorType.nextSteps = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationErrorType; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationParameters.java new file mode 100644 index 000000000000..19c0cfbfde95 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Request body for Migrate operation. + */ +@Fluent +public final class MigrationParameters implements JsonSerializable { + /* + * Sku for the migration + */ + private Sku sku; + + /* + * Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + */ + private ResourceReference classicResourceReference; + + /* + * Name of the new profile that need to be created. + */ + private String profileName; + + /* + * Waf mapping for the migrated profile + */ + private List migrationWebApplicationFirewallMappings; + + /** + * Creates an instance of MigrationParameters class. + */ + public MigrationParameters() { + } + + /** + * Get the sku property: Sku for the migration. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku for the migration. + * + * @param sku the sku value to set. + * @return the MigrationParameters object itself. + */ + public MigrationParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the classicResourceReference property: Resource reference of the classic cdn profile or classic frontdoor + * that need to be migrated. + * + * @return the classicResourceReference value. + */ + public ResourceReference classicResourceReference() { + return this.classicResourceReference; + } + + /** + * Set the classicResourceReference property: Resource reference of the classic cdn profile or classic frontdoor + * that need to be migrated. + * + * @param classicResourceReference the classicResourceReference value to set. + * @return the MigrationParameters object itself. + */ + public MigrationParameters withClassicResourceReference(ResourceReference classicResourceReference) { + this.classicResourceReference = classicResourceReference; + return this; + } + + /** + * Get the profileName property: Name of the new profile that need to be created. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Set the profileName property: Name of the new profile that need to be created. + * + * @param profileName the profileName value to set. + * @return the MigrationParameters object itself. + */ + public MigrationParameters withProfileName(String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get the migrationWebApplicationFirewallMappings property: Waf mapping for the migrated profile. + * + * @return the migrationWebApplicationFirewallMappings value. + */ + public List migrationWebApplicationFirewallMappings() { + return this.migrationWebApplicationFirewallMappings; + } + + /** + * Set the migrationWebApplicationFirewallMappings property: Waf mapping for the migrated profile. + * + * @param migrationWebApplicationFirewallMappings the migrationWebApplicationFirewallMappings value to set. + * @return the MigrationParameters object itself. + */ + public MigrationParameters withMigrationWebApplicationFirewallMappings( + List migrationWebApplicationFirewallMappings) { + this.migrationWebApplicationFirewallMappings = migrationWebApplicationFirewallMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sku in model MigrationParameters")); + } else { + sku().validate(); + } + if (classicResourceReference() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property classicResourceReference in model MigrationParameters")); + } else { + classicResourceReference().validate(); + } + if (profileName() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property profileName in model MigrationParameters")); + } + if (migrationWebApplicationFirewallMappings() != null) { + migrationWebApplicationFirewallMappings().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrationParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("classicResourceReference", this.classicResourceReference); + jsonWriter.writeStringField("profileName", this.profileName); + jsonWriter.writeArrayField("migrationWebApplicationFirewallMappings", + this.migrationWebApplicationFirewallMappings, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrationParameters. + */ + public static MigrationParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationParameters deserializedMigrationParameters = new MigrationParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedMigrationParameters.sku = Sku.fromJson(reader); + } else if ("classicResourceReference".equals(fieldName)) { + deserializedMigrationParameters.classicResourceReference = ResourceReference.fromJson(reader); + } else if ("profileName".equals(fieldName)) { + deserializedMigrationParameters.profileName = reader.getString(); + } else if ("migrationWebApplicationFirewallMappings".equals(fieldName)) { + List migrationWebApplicationFirewallMappings + = reader.readArray(reader1 -> MigrationWebApplicationFirewallMapping.fromJson(reader1)); + deserializedMigrationParameters.migrationWebApplicationFirewallMappings + = migrationWebApplicationFirewallMappings; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationWebApplicationFirewallMapping.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationWebApplicationFirewallMapping.java new file mode 100644 index 000000000000..f598f3b9daf0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationWebApplicationFirewallMapping.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Web Application Firewall Mapping. + */ +@Fluent +public final class MigrationWebApplicationFirewallMapping + implements JsonSerializable { + /* + * Migration From Waf policy + */ + private ResourceReference migratedFrom; + + /* + * Migration to Waf policy + */ + private ResourceReference migratedTo; + + /** + * Creates an instance of MigrationWebApplicationFirewallMapping class. + */ + public MigrationWebApplicationFirewallMapping() { + } + + /** + * Get the migratedFrom property: Migration From Waf policy. + * + * @return the migratedFrom value. + */ + public ResourceReference migratedFrom() { + return this.migratedFrom; + } + + /** + * Set the migratedFrom property: Migration From Waf policy. + * + * @param migratedFrom the migratedFrom value to set. + * @return the MigrationWebApplicationFirewallMapping object itself. + */ + public MigrationWebApplicationFirewallMapping withMigratedFrom(ResourceReference migratedFrom) { + this.migratedFrom = migratedFrom; + return this; + } + + /** + * Get the migratedTo property: Migration to Waf policy. + * + * @return the migratedTo value. + */ + public ResourceReference migratedTo() { + return this.migratedTo; + } + + /** + * Set the migratedTo property: Migration to Waf policy. + * + * @param migratedTo the migratedTo value to set. + * @return the MigrationWebApplicationFirewallMapping object itself. + */ + public MigrationWebApplicationFirewallMapping withMigratedTo(ResourceReference migratedTo) { + this.migratedTo = migratedTo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migratedFrom() != null) { + migratedFrom().validate(); + } + if (migratedTo() != null) { + migratedTo().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("migratedFrom", this.migratedFrom); + jsonWriter.writeJsonField("migratedTo", this.migratedTo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationWebApplicationFirewallMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationWebApplicationFirewallMapping if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationWebApplicationFirewallMapping. + */ + public static MigrationWebApplicationFirewallMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationWebApplicationFirewallMapping deserializedMigrationWebApplicationFirewallMapping + = new MigrationWebApplicationFirewallMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migratedFrom".equals(fieldName)) { + deserializedMigrationWebApplicationFirewallMapping.migratedFrom + = ResourceReference.fromJson(reader); + } else if ("migratedTo".equals(fieldName)) { + deserializedMigrationWebApplicationFirewallMapping.migratedTo = ResourceReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationWebApplicationFirewallMapping; + }); + } +} 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 000000000000..782607ae6ef8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MinimumTlsVersion.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; + +/** + * TLS protocol version that will be used for Https. + */ +public enum MinimumTlsVersion { + /** + * Enum value None. + */ + NONE("None"), + + /** + * Enum value TLS10. + */ + TLS10("TLS10"), + + /** + * Enum value TLS12. + */ + TLS12("TLS12"); + + /** + * The actual serialized value for a MinimumTlsVersion instance. + */ + private final String value; + + MinimumTlsVersion(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MinimumTlsVersion instance. + * + * @param value the serialized value to parse. + * @return the parsed MinimumTlsVersion object, or null if unable to parse. + */ + public static MinimumTlsVersion fromString(String value) { + if (value == null) { + return null; + } + MinimumTlsVersion[] items = MinimumTlsVersion.values(); + for (MinimumTlsVersion item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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 000000000000..1dc089d45e04 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operation.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.resourcemanager.cdn.generated.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The origin of operations. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationDisplay.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationDisplay.java new file mode 100644 index 000000000000..4c3643488976 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationDisplay.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The object that represents the operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * Service provider: Microsoft.Cdn + */ + private String provider; + + /* + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + private String resource; + + /* + * Operation type: Read, write, delete, etc. + */ + private String operation; + + /* + * Description of operation. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: Service provider: Microsoft.Cdn. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: Resource on which the operation is performed: Profile, endpoint, etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: Operation type: Read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: Description of operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/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 000000000000..645848ec40e2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * Lists all of the available CDN REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationsListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationsListResult.java new file mode 100644 index 000000000000..d3007ce4ce7a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationsListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of CDN operations supported by the CDN resource provider. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of OperationsListResult class. + */ + public OperationsListResult() { + } + + /** + * Get the value property: List of CDN operations supported by the CDN resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of CDN operations supported by the CDN resource provider. + * + * @param value the value value to set. + * @return the OperationsListResult object itself. + */ + public OperationsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationsListResult object itself. + */ + public OperationsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationsListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationsListResult. + */ + public static OperationsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationsListResult deserializedOperationsListResult = new OperationsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationsListResult; + }); + } +} 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 000000000000..3c4081b26d6f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operator.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class Operator extends ExpandableStringEnum { + /** + * Static value Any for Operator. + */ + public static final Operator ANY = fromString("Any"); + + /** + * Static value IPMatch for Operator. + */ + public static final Operator IPMATCH = fromString("IPMatch"); + + /** + * Static value GeoMatch for Operator. + */ + public static final Operator GEO_MATCH = fromString("GeoMatch"); + + /** + * Static value Equal for Operator. + */ + public static final Operator EQUAL = fromString("Equal"); + + /** + * Static value Contains for Operator. + */ + public static final Operator CONTAINS = fromString("Contains"); + + /** + * Static value LessThan for Operator. + */ + public static final Operator LESS_THAN = fromString("LessThan"); + + /** + * Static value GreaterThan for Operator. + */ + public static final Operator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value LessThanOrEqual for Operator. + */ + public static final Operator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThanOrEqual for Operator. + */ + public static final Operator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value BeginsWith for Operator. + */ + public static final Operator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for Operator. + */ + public static final Operator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value RegEx for Operator. + */ + public static final Operator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of Operator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Operator() { + } + + /** + * Creates or finds a Operator from its string representation. + * + * @param name a name to look for. + * @return the corresponding Operator. + */ + public static Operator fromString(String name) { + return fromString(name, Operator.class); + } + + /** + * Gets known Operator values. + * + * @return known Operator values. + */ + public static Collection values() { + return values(Operator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OptimizationType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OptimizationType.java new file mode 100644 index 000000000000..53c3a60c7d62 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OptimizationType.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies what scenario the customer wants this CDN endpoint to optimize, e.g. Download, Media services. With this + * information we can apply scenario driven optimization. + */ +public final class OptimizationType extends ExpandableStringEnum { + /** + * Static value GeneralWebDelivery for OptimizationType. + */ + public static final OptimizationType GENERAL_WEB_DELIVERY = fromString("GeneralWebDelivery"); + + /** + * Static value GeneralMediaStreaming for OptimizationType. + */ + public static final OptimizationType GENERAL_MEDIA_STREAMING = fromString("GeneralMediaStreaming"); + + /** + * Static value VideoOnDemandMediaStreaming for OptimizationType. + */ + public static final OptimizationType VIDEO_ON_DEMAND_MEDIA_STREAMING = fromString("VideoOnDemandMediaStreaming"); + + /** + * Static value LargeFileDownload for OptimizationType. + */ + public static final OptimizationType LARGE_FILE_DOWNLOAD = fromString("LargeFileDownload"); + + /** + * Static value DynamicSiteAcceleration for OptimizationType. + */ + public static final OptimizationType DYNAMIC_SITE_ACCELERATION = fromString("DynamicSiteAcceleration"); + + /** + * Creates a new instance of OptimizationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OptimizationType() { + } + + /** + * Creates or finds a OptimizationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OptimizationType. + */ + public static OptimizationType fromString(String name) { + return fromString(name, OptimizationType.class); + } + + /** + * Gets known OptimizationType values. + * + * @return known OptimizationType values. + */ + public static Collection values() { + return values(OptimizationType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origin.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origin.java new file mode 100644 index 000000000000..ad139a6376c9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origin.java @@ -0,0 +1,598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; + +/** + * An immutable client-side representation of Origin. + */ +public interface Origin { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the resourceState property: Resource status of the origin. + * + * @return the resourceState value. + */ + OriginResourceState resourceState(); + + /** + * Gets the provisioningState property: Provisioning status of the origin. + * + * @return the provisioningState value. + */ + OriginProvisioningState provisioningState(); + + /** + * Gets the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + PrivateEndpointStatus privateEndpointStatus(); + + /** + * Gets the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + Integer httpPort(); + + /** + * Gets the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + Integer httpsPort(); + + /** + * Gets the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @return the originHostHeader value. + */ + String originHostHeader(); + + /** + * Gets the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + Integer weight(); + + /** + * Gets the enabled property: Origin is enabled for load balancing or not. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + String privateLinkAlias(); + + /** + * Gets the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + String privateLinkResourceId(); + + /** + * Gets the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + String privateLinkLocation(); + + /** + * Gets the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + String privateLinkApprovalMessage(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner object. + * + * @return the inner object. + */ + OriginInner innerModel(); + + /** + * The entirety of the Origin definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Origin definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Origin definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Origin definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, endpointName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @return the next definition stage. + */ + WithCreate withExistingEndpoint(String resourceGroupName, String profileName, String endpointName); + } + + /** + * The stage of the Origin definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithHostname, DefinitionStages.WithHttpPort, + DefinitionStages.WithHttpsPort, DefinitionStages.WithOriginHostHeader, DefinitionStages.WithPriority, + DefinitionStages.WithWeight, DefinitionStages.WithEnabled, DefinitionStages.WithPrivateLinkAlias, + DefinitionStages.WithPrivateLinkResourceId, DefinitionStages.WithPrivateLinkLocation, + DefinitionStages.WithPrivateLinkApprovalMessage { + /** + * Executes the create request. + * + * @return the created resource. + */ + Origin create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Origin create(Context context); + } + + /** + * The stage of the Origin definition allowing to specify hostname. + */ + interface WithHostname { + /** + * Specifies the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 + * addresses are supported.This should be unique across all origins in an endpoint.. + * + * @param hostname The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + + /** + * The stage of the Origin definition allowing to specify httpPort. + */ + interface WithHttpPort { + /** + * Specifies the httpPort property: The value of the HTTP port. Must be between 1 and 65535.. + * + * @param httpPort The value of the HTTP port. Must be between 1 and 65535. + * @return the next definition stage. + */ + WithCreate withHttpPort(Integer httpPort); + } + + /** + * The stage of the Origin definition allowing to specify httpsPort. + */ + interface WithHttpsPort { + /** + * Specifies the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535.. + * + * @param httpsPort The value of the HTTPS port. Must be between 1 and 65535. + * @return the next definition stage. + */ + WithCreate withHttpsPort(Integer httpsPort); + } + + /** + * The stage of the Origin definition allowing to specify originHostHeader. + */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. If + * you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * This overrides the host header defined at Endpoint. + * + * @param originHostHeader The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the + * host header defined at Endpoint. + * @return the next definition stage. + */ + WithCreate withOriginHostHeader(String originHostHeader); + } + + /** + * The stage of the Origin definition allowing to specify priority. + */ + interface WithPriority { + /** + * Specifies the priority property: Priority of origin in given origin group for load balancing. Higher + * priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + * and 5. + * + * @param priority Priority of origin in given origin group for load balancing. Higher priorities will not + * be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + + /** + * The stage of the Origin definition allowing to specify weight. + */ + interface WithWeight { + /** + * Specifies the weight property: Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000. + * + * @param weight Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. + * @return the next definition stage. + */ + WithCreate withWeight(Integer weight); + } + + /** + * The stage of the Origin definition allowing to specify enabled. + */ + interface WithEnabled { + /** + * Specifies the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled Origin is enabled for load balancing or not. + * @return the next definition stage. + */ + WithCreate withEnabled(Boolean enabled); + } + + /** + * The stage of the Origin definition allowing to specify privateLinkAlias. + */ + interface WithPrivateLinkAlias { + /** + * Specifies the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional + * field indicates that this origin is 'Private'. + * + * @param privateLinkAlias The Alias of the Private Link resource. Populating this optional field indicates + * that this origin is 'Private'. + * @return the next definition stage. + */ + WithCreate withPrivateLinkAlias(String privateLinkAlias); + } + + /** + * The stage of the Origin definition allowing to specify privateLinkResourceId. + */ + interface WithPrivateLinkResourceId { + /** + * Specifies the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating + * this optional field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId The Resource Id of the Private Link resource. Populating this optional field + * indicates that this backend is 'Private'. + * @return the next definition stage. + */ + WithCreate withPrivateLinkResourceId(String privateLinkResourceId); + } + + /** + * The stage of the Origin definition allowing to specify privateLinkLocation. + */ + interface WithPrivateLinkLocation { + /** + * Specifies the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * @return the next definition stage. + */ + WithCreate withPrivateLinkLocation(String privateLinkLocation); + } + + /** + * The stage of the Origin definition allowing to specify privateLinkApprovalMessage. + */ + interface WithPrivateLinkApprovalMessage { + /** + * Specifies the privateLinkApprovalMessage property: A custom message to be included in the approval + * request to connect to the Private Link.. + * + * @param privateLinkApprovalMessage A custom message to be included in the approval request to connect to + * the Private Link. + * @return the next definition stage. + */ + WithCreate withPrivateLinkApprovalMessage(String privateLinkApprovalMessage); + } + } + + /** + * Begins update for the Origin resource. + * + * @return the stage of resource update. + */ + Origin.Update update(); + + /** + * The template for Origin update. + */ + interface Update extends UpdateStages.WithHostname, UpdateStages.WithHttpPort, UpdateStages.WithHttpsPort, + UpdateStages.WithOriginHostHeader, UpdateStages.WithPriority, UpdateStages.WithWeight, UpdateStages.WithEnabled, + UpdateStages.WithPrivateLinkAlias, UpdateStages.WithPrivateLinkResourceId, UpdateStages.WithPrivateLinkLocation, + UpdateStages.WithPrivateLinkApprovalMessage { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Origin apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Origin apply(Context context); + } + + /** + * The Origin update stages. + */ + interface UpdateStages { + /** + * The stage of the Origin update allowing to specify hostname. + */ + interface WithHostname { + /** + * Specifies the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 + * addresses are supported.This should be unique across all origins in an endpoint.. + * + * @param hostname The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * @return the next definition stage. + */ + Update withHostname(String hostname); + } + + /** + * The stage of the Origin update allowing to specify httpPort. + */ + interface WithHttpPort { + /** + * Specifies the httpPort property: The value of the HTTP port. Must be between 1 and 65535.. + * + * @param httpPort The value of the HTTP port. Must be between 1 and 65535. + * @return the next definition stage. + */ + Update withHttpPort(Integer httpPort); + } + + /** + * The stage of the Origin update allowing to specify httpsPort. + */ + interface WithHttpsPort { + /** + * Specifies the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535.. + * + * @param httpsPort The value of the HTTPS port. Must be between 1 and 65535. + * @return the next definition stage. + */ + Update withHttpsPort(Integer httpsPort); + } + + /** + * The stage of the Origin update allowing to specify originHostHeader. + */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. If + * you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * This overrides the host header defined at Endpoint. + * + * @param originHostHeader The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the + * host header defined at Endpoint. + * @return the next definition stage. + */ + Update withOriginHostHeader(String originHostHeader); + } + + /** + * The stage of the Origin update allowing to specify priority. + */ + interface WithPriority { + /** + * Specifies the priority property: Priority of origin in given origin group for load balancing. Higher + * priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + * and 5. + * + * @param priority Priority of origin in given origin group for load balancing. Higher priorities will not + * be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + + /** + * The stage of the Origin update allowing to specify weight. + */ + interface WithWeight { + /** + * Specifies the weight property: Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000. + * + * @param weight Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. + * @return the next definition stage. + */ + Update withWeight(Integer weight); + } + + /** + * The stage of the Origin update allowing to specify enabled. + */ + interface WithEnabled { + /** + * Specifies the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled Origin is enabled for load balancing or not. + * @return the next definition stage. + */ + Update withEnabled(Boolean enabled); + } + + /** + * The stage of the Origin update allowing to specify privateLinkAlias. + */ + interface WithPrivateLinkAlias { + /** + * Specifies the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional + * field indicates that this origin is 'Private'. + * + * @param privateLinkAlias The Alias of the Private Link resource. Populating this optional field indicates + * that this origin is 'Private'. + * @return the next definition stage. + */ + Update withPrivateLinkAlias(String privateLinkAlias); + } + + /** + * The stage of the Origin update allowing to specify privateLinkResourceId. + */ + interface WithPrivateLinkResourceId { + /** + * Specifies the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating + * this optional field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId The Resource Id of the Private Link resource. Populating this optional field + * indicates that this backend is 'Private'. + * @return the next definition stage. + */ + Update withPrivateLinkResourceId(String privateLinkResourceId); + } + + /** + * The stage of the Origin update allowing to specify privateLinkLocation. + */ + interface WithPrivateLinkLocation { + /** + * Specifies the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * @return the next definition stage. + */ + Update withPrivateLinkLocation(String privateLinkLocation); + } + + /** + * The stage of the Origin update allowing to specify privateLinkApprovalMessage. + */ + interface WithPrivateLinkApprovalMessage { + /** + * Specifies the privateLinkApprovalMessage property: A custom message to be included in the approval + * request to connect to the Private Link.. + * + * @param privateLinkApprovalMessage A custom message to be included in the approval request to connect to + * the Private Link. + * @return the next definition stage. + */ + Update withPrivateLinkApprovalMessage(String privateLinkApprovalMessage); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Origin refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Origin refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroup.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroup.java new file mode 100644 index 000000000000..7edb6fc24863 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroup.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import java.util.List; + +/** + * An immutable client-side representation of OriginGroup. + */ +public interface OriginGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the resourceState property: Resource status of the origin group. + * + * @return the resourceState value. + */ + OriginGroupResourceState resourceState(); + + /** + * Gets the provisioningState property: Provisioning status of the origin group. + * + * @return the provisioningState value. + */ + OriginGroupProvisioningState provisioningState(); + + /** + * Gets the healthProbeSettings property: Health probe settings to the origin that is used to determine the health + * of the origin. + * + * @return the healthProbeSettings value. + */ + HealthProbeParameters healthProbeSettings(); + + /** + * Gets the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + List origins(); + + /** + * Gets the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + + /** + * Gets the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner object. + * + * @return the inner object. + */ + OriginGroupInner innerModel(); + + /** + * The entirety of the OriginGroup definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The OriginGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the OriginGroup definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the OriginGroup definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, endpointName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @return the next definition stage. + */ + WithCreate withExistingEndpoint(String resourceGroupName, String profileName, String endpointName); + } + + /** + * The stage of the OriginGroup definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithHealthProbeSettings, DefinitionStages.WithOrigins, + DefinitionStages.WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes, + DefinitionStages.WithResponseBasedOriginErrorDetectionSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + OriginGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OriginGroup create(Context context); + } + + /** + * The stage of the OriginGroup definition allowing to specify healthProbeSettings. + */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings to the origin that is used to determine + * the health of the origin.. + * + * @param healthProbeSettings Health probe settings to the origin that is used to determine the health of + * the origin. + * @return the next definition stage. + */ + WithCreate withHealthProbeSettings(HealthProbeParameters healthProbeSettings); + } + + /** + * The stage of the OriginGroup definition allowing to specify origins. + */ + interface WithOrigins { + /** + * Specifies the origins property: The source of the content being delivered via CDN within given origin + * group.. + * + * @param origins The source of the content being delivered via CDN within given origin group. + * @return the next definition stage. + */ + WithCreate withOrigins(List origins); + } + + /** + * The stage of the OriginGroup definition allowing to specify + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes. + */ + interface WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes { + /** + * Specifies the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift + * the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is + * added. Default is 10 mins. This property is currently not supported.. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes Time in minutes to shift the traffic to the + * endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 + * mins. This property is currently not supported. + * @return the next definition stage. + */ + WithCreate withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + } + + /** + * The stage of the OriginGroup definition allowing to specify responseBasedOriginErrorDetectionSettings. + */ + interface WithResponseBasedOriginErrorDetectionSettings { + /** + * Specifies the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the + * properties to determine origin health using real requests/responses. This property is currently not + * supported.. + * + * @param responseBasedOriginErrorDetectionSettings The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * @return the next definition stage. + */ + WithCreate withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings); + } + } + + /** + * Begins update for the OriginGroup resource. + * + * @return the stage of resource update. + */ + OriginGroup.Update update(); + + /** + * The template for OriginGroup update. + */ + interface Update extends UpdateStages.WithHealthProbeSettings, UpdateStages.WithOrigins, + UpdateStages.WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes, + UpdateStages.WithResponseBasedOriginErrorDetectionSettings { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OriginGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OriginGroup apply(Context context); + } + + /** + * The OriginGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the OriginGroup update allowing to specify healthProbeSettings. + */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings to the origin that is used to determine + * the health of the origin.. + * + * @param healthProbeSettings Health probe settings to the origin that is used to determine the health of + * the origin. + * @return the next definition stage. + */ + Update withHealthProbeSettings(HealthProbeParameters healthProbeSettings); + } + + /** + * The stage of the OriginGroup update allowing to specify origins. + */ + interface WithOrigins { + /** + * Specifies the origins property: The source of the content being delivered via CDN within given origin + * group.. + * + * @param origins The source of the content being delivered via CDN within given origin group. + * @return the next definition stage. + */ + Update withOrigins(List origins); + } + + /** + * The stage of the OriginGroup update allowing to specify + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes. + */ + interface WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes { + /** + * Specifies the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift + * the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is + * added. Default is 10 mins. This property is currently not supported.. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes Time in minutes to shift the traffic to the + * endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 + * mins. This property is currently not supported. + * @return the next definition stage. + */ + Update withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + } + + /** + * The stage of the OriginGroup update allowing to specify responseBasedOriginErrorDetectionSettings. + */ + interface WithResponseBasedOriginErrorDetectionSettings { + /** + * Specifies the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the + * properties to determine origin health using real requests/responses. This property is currently not + * supported.. + * + * @param responseBasedOriginErrorDetectionSettings The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * @return the next definition stage. + */ + Update withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OriginGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OriginGroup refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupListResult.java new file mode 100644 index 000000000000..d750a58cfef6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of CDN origin groups within an endpoint + */ + private List value; + + /* + * URL to get the next set of origin objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of OriginGroupListResult class. + */ + public OriginGroupListResult() { + } + + /** + * Get the value property: List of CDN origin groups within an endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of origin objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of origin objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OriginGroupListResult object itself. + */ + public OriginGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroupListResult. + */ + public static OriginGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupListResult deserializedOriginGroupListResult = new OriginGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OriginGroupInner.fromJson(reader1)); + deserializedOriginGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOriginGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupListResult; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverride.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverride.java new file mode 100644 index 000000000000..de66c106f201 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverride.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for the origin group override configuration. + */ +@Fluent +public final class OriginGroupOverride implements JsonSerializable { + /* + * defines the OriginGroup that would override the DefaultOriginGroup on route. + */ + private ResourceReference originGroup; + + /* + * Protocol this rule will use when forwarding traffic to backends. + */ + private ForwardingProtocol forwardingProtocol; + + /** + * Creates an instance of OriginGroupOverride class. + */ + public OriginGroupOverride() { + } + + /** + * Get the originGroup property: defines the OriginGroup that would override the DefaultOriginGroup on route. + * + * @return the originGroup value. + */ + public ResourceReference originGroup() { + return this.originGroup; + } + + /** + * Set the originGroup property: defines the OriginGroup that would override the DefaultOriginGroup on route. + * + * @param originGroup the originGroup value to set. + * @return the OriginGroupOverride object itself. + */ + public OriginGroupOverride withOriginGroup(ResourceReference originGroup) { + this.originGroup = originGroup; + return this; + } + + /** + * Get the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + public ForwardingProtocol forwardingProtocol() { + return this.forwardingProtocol; + } + + /** + * Set the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @param forwardingProtocol the forwardingProtocol value to set. + * @return the OriginGroupOverride object itself. + */ + public OriginGroupOverride withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + this.forwardingProtocol = forwardingProtocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (originGroup() != null) { + originGroup().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("originGroup", this.originGroup); + jsonWriter.writeStringField("forwardingProtocol", + this.forwardingProtocol == null ? null : this.forwardingProtocol.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupOverride if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroupOverride. + */ + public static OriginGroupOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupOverride deserializedOriginGroupOverride = new OriginGroupOverride(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("originGroup".equals(fieldName)) { + deserializedOriginGroupOverride.originGroup = ResourceReference.fromJson(reader); + } else if ("forwardingProtocol".equals(fieldName)) { + deserializedOriginGroupOverride.forwardingProtocol + = ForwardingProtocol.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupOverride; + }); + } +} 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 000000000000..d870134f9423 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideAction.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the origin group override action for the delivery rule. + */ +@Fluent +public final class OriginGroupOverrideAction extends DeliveryRuleAction { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.ORIGIN_GROUP_OVERRIDE; + + /* + * Defines the parameters for the action. + */ + private OriginGroupOverrideActionParameters parameters; + + /** + * Creates an instance of OriginGroupOverrideAction class. + */ + public OriginGroupOverrideAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + @Override + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model OriginGroupOverrideAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OriginGroupOverrideAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupOverrideAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupOverrideAction if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OriginGroupOverrideAction. + */ + public static OriginGroupOverrideAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupOverrideAction deserializedOriginGroupOverrideAction = new OriginGroupOverrideAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedOriginGroupOverrideAction.parameters + = OriginGroupOverrideActionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedOriginGroupOverrideAction.name = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupOverrideAction; + }); + } +} 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 000000000000..fdee76702dfb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideActionParameters.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for the origin group override action. + */ +@Fluent +public final class OriginGroupOverrideActionParameters extends DeliveryRuleActionParameters { + /* + * The typeName property. + */ + private DeliveryRuleActionParametersType typeName + = DeliveryRuleActionParametersType.DELIVERY_RULE_ORIGIN_GROUP_OVERRIDE_ACTION_PARAMETERS; + + /* + * defines the OriginGroup that would override the DefaultOriginGroup. + */ + private ResourceReference originGroup; + + /** + * Creates an instance of OriginGroupOverrideActionParameters class. + */ + public OriginGroupOverrideActionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleActionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (originGroup() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property originGroup in model OriginGroupOverrideActionParameters")); + } else { + originGroup().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OriginGroupOverrideActionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("originGroup", this.originGroup); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupOverrideActionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupOverrideActionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OriginGroupOverrideActionParameters. + */ + public static OriginGroupOverrideActionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupOverrideActionParameters deserializedOriginGroupOverrideActionParameters + = new OriginGroupOverrideActionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("originGroup".equals(fieldName)) { + deserializedOriginGroupOverrideActionParameters.originGroup = ResourceReference.fromJson(reader); + } else if ("typeName".equals(fieldName)) { + deserializedOriginGroupOverrideActionParameters.typeName + = DeliveryRuleActionParametersType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupOverrideActionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProvisioningState.java new file mode 100644 index 000000000000..5a84eaed79ee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning status of the origin group. + */ +public final class OriginGroupProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for OriginGroupProvisioningState. + */ + public static final OriginGroupProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for OriginGroupProvisioningState. + */ + public static final OriginGroupProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Updating for OriginGroupProvisioningState. + */ + public static final OriginGroupProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for OriginGroupProvisioningState. + */ + public static final OriginGroupProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Creating for OriginGroupProvisioningState. + */ + public static final OriginGroupProvisioningState CREATING = fromString("Creating"); + + /** + * Creates a new instance of OriginGroupProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OriginGroupProvisioningState() { + } + + /** + * Creates or finds a OriginGroupProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OriginGroupProvisioningState. + */ + public static OriginGroupProvisioningState fromString(String name) { + return fromString(name, OriginGroupProvisioningState.class); + } + + /** + * Gets known OriginGroupProvisioningState values. + * + * @return known OriginGroupProvisioningState values. + */ + public static Collection values() { + return values(OriginGroupProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupResourceState.java new file mode 100644 index 000000000000..b4f2ef1121b5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupResourceState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource status of the origin group. + */ +public final class OriginGroupResourceState extends ExpandableStringEnum { + /** + * Static value Creating for OriginGroupResourceState. + */ + public static final OriginGroupResourceState CREATING = fromString("Creating"); + + /** + * Static value Active for OriginGroupResourceState. + */ + public static final OriginGroupResourceState ACTIVE = fromString("Active"); + + /** + * Static value Deleting for OriginGroupResourceState. + */ + public static final OriginGroupResourceState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of OriginGroupResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OriginGroupResourceState() { + } + + /** + * Creates or finds a OriginGroupResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OriginGroupResourceState. + */ + public static OriginGroupResourceState fromString(String name) { + return fromString(name, OriginGroupResourceState.class); + } + + /** + * Gets known OriginGroupResourceState values. + * + * @return known OriginGroupResourceState values. + */ + public static Collection values() { + return values(OriginGroupResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdateParameters.java new file mode 100644 index 000000000000..834f7f3fd2b4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdateParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupUpdatePropertiesParameters; +import java.io.IOException; +import java.util.List; + +/** + * Origin group properties needed for origin group creation or update. + */ +@Fluent +public final class OriginGroupUpdateParameters implements JsonSerializable { + /* + * The JSON object that contains the properties of the origin group. + */ + private OriginGroupUpdatePropertiesParameters innerProperties; + + /** + * Creates an instance of OriginGroupUpdateParameters class. + */ + public OriginGroupUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin group. + * + * @return the innerProperties value. + */ + private OriginGroupUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.innerProperties() == null ? null : this.innerProperties().origins(); + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters withOrigins(List origins) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withOrigins(origins); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupUpdatePropertiesParameters(); + } + this.innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.innerProperties() == null + ? null + : this.innerProperties().responseBasedOriginErrorDetectionSettings(); + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupUpdateParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroupUpdateParameters. + */ + public static OriginGroupUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupUpdateParameters deserializedOriginGroupUpdateParameters = new OriginGroupUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedOriginGroupUpdateParameters.innerProperties + = OriginGroupUpdatePropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupUpdateParameters; + }); + } +} 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 000000000000..9a0ae715e7ee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroups.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OriginGroups. + */ +public interface OriginGroups { + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String originGroupName, Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint. + */ + OriginGroup get(String resourceGroupName, String profileName, String endpointName, String originGroupName); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName, String originGroupName); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName, String originGroupName, + Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response}. + */ + OriginGroup getById(String id); + + /** + * Gets an existing origin group within an endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OriginGroup resource. + * + * @param name resource name. + * @return the first stage of the new OriginGroup definition. + */ + OriginGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginListResult.java new file mode 100644 index 000000000000..98b9f910bbf7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of CDN origins within an endpoint + */ + private List value; + + /* + * URL to get the next set of origin objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of OriginListResult class. + */ + public OriginListResult() { + } + + /** + * Get the value property: List of CDN origins within an endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of origin objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of origin objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OriginListResult object itself. + */ + public OriginListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginListResult. + */ + public static OriginListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginListResult deserializedOriginListResult = new OriginListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OriginInner.fromJson(reader1)); + deserializedOriginListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOriginListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginListResult; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginProvisioningState.java new file mode 100644 index 000000000000..265c419e443d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning status of the origin. + */ +public final class OriginProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for OriginProvisioningState. + */ + public static final OriginProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for OriginProvisioningState. + */ + public static final OriginProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Updating for OriginProvisioningState. + */ + public static final OriginProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for OriginProvisioningState. + */ + public static final OriginProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Creating for OriginProvisioningState. + */ + public static final OriginProvisioningState CREATING = fromString("Creating"); + + /** + * Creates a new instance of OriginProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OriginProvisioningState() { + } + + /** + * Creates or finds a OriginProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OriginProvisioningState. + */ + public static OriginProvisioningState fromString(String name) { + return fromString(name, OriginProvisioningState.class); + } + + /** + * Gets known OriginProvisioningState values. + * + * @return known OriginProvisioningState values. + */ + public static Collection values() { + return values(OriginProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginResourceState.java new file mode 100644 index 000000000000..5c3ee2d43fdd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginResourceState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource status of the origin. + */ +public final class OriginResourceState extends ExpandableStringEnum { + /** + * Static value Creating for OriginResourceState. + */ + public static final OriginResourceState CREATING = fromString("Creating"); + + /** + * Static value Active for OriginResourceState. + */ + public static final OriginResourceState ACTIVE = fromString("Active"); + + /** + * Static value Deleting for OriginResourceState. + */ + public static final OriginResourceState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of OriginResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OriginResourceState() { + } + + /** + * Creates or finds a OriginResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OriginResourceState. + */ + public static OriginResourceState fromString(String name) { + return fromString(name, OriginResourceState.class); + } + + /** + * Gets known OriginResourceState values. + * + * @return known OriginResourceState values. + */ + public static Collection values() { + return values(OriginResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdateParameters.java new file mode 100644 index 000000000000..6385f99ef61e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdateParameters.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginUpdatePropertiesParameters; +import java.io.IOException; + +/** + * Origin properties needed for origin update. + */ +@Fluent +public final class OriginUpdateParameters implements JsonSerializable { + /* + * The JSON object that contains the properties of the origin. + */ + private OriginUpdatePropertiesParameters innerProperties; + + /** + * Creates an instance of OriginUpdateParameters class. + */ + public OriginUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin. + * + * @return the innerProperties value. + */ + private OriginUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled the enabled value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkAlias(); + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPrivateLinkAlias(String privateLinkAlias) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPrivateLinkAlias(privateLinkAlias); + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId(); + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPrivateLinkResourceId(String privateLinkResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkLocation(); + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPrivateLinkLocation(String privateLinkLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPrivateLinkLocation(privateLinkLocation); + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkApprovalMessage(); + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginUpdateParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginUpdateParameters. + */ + public static OriginUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginUpdateParameters deserializedOriginUpdateParameters = new OriginUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedOriginUpdateParameters.innerProperties + = OriginUpdatePropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginUpdateParameters; + }); + } +} 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 000000000000..be4ae4f15d69 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origins.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 Origins. + */ +public interface Origins { + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, + String originName, Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint. + */ + Origin get(String resourceGroupName, String profileName, String endpointName, String originName); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName, String originName); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName, String originName, Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response}. + */ + Origin getById(String id); + + /** + * Gets an existing origin within an endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing origin within an endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing origin within an endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Origin resource. + * + * @param name resource name. + * @return the first stage of the new Origin definition. + */ + Origin.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ParamIndicator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ParamIndicator.java new file mode 100644 index 000000000000..9ea795aad2ca --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ParamIndicator.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates the purpose of the parameter. + */ +public final class ParamIndicator extends ExpandableStringEnum { + /** + * Static value Expires for ParamIndicator. + */ + public static final ParamIndicator EXPIRES = fromString("Expires"); + + /** + * Static value KeyId for ParamIndicator. + */ + public static final ParamIndicator KEY_ID = fromString("KeyId"); + + /** + * Static value Signature for ParamIndicator. + */ + public static final ParamIndicator SIGNATURE = fromString("Signature"); + + /** + * Creates a new instance of ParamIndicator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ParamIndicator() { + } + + /** + * Creates or finds a ParamIndicator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ParamIndicator. + */ + public static ParamIndicator fromString(String name) { + return fromString(name, ParamIndicator.class); + } + + /** + * Gets known ParamIndicator values. + * + * @return known ParamIndicator values. + */ + public static Collection values() { + return values(ParamIndicator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Policies.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Policies.java new file mode 100644 index 000000000000..2dbbd91a7bef --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Policies.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 Policies. + */ +public interface Policies { + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String policyName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + CdnWebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String policyName, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String policyName); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response}. + */ + CdnWebApplicationFirewallPolicy getById(String id); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes Policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes Policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CdnWebApplicationFirewallPolicy resource. + * + * @param name resource name. + * @return the first stage of the new CdnWebApplicationFirewallPolicy definition. + */ + CdnWebApplicationFirewallPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyEnabledState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyEnabledState.java new file mode 100644 index 000000000000..1b59c9e748cc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyEnabledState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * describes if the policy is in enabled state or disabled state. + */ +public final class PolicyEnabledState extends ExpandableStringEnum { + /** + * Static value Disabled for PolicyEnabledState. + */ + public static final PolicyEnabledState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for PolicyEnabledState. + */ + public static final PolicyEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of PolicyEnabledState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PolicyEnabledState() { + } + + /** + * Creates or finds a PolicyEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyEnabledState. + */ + public static PolicyEnabledState fromString(String name) { + return fromString(name, PolicyEnabledState.class); + } + + /** + * Gets known PolicyEnabledState values. + * + * @return known PolicyEnabledState values. + */ + public static Collection values() { + return values(PolicyEnabledState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyMode.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyMode.java new file mode 100644 index 000000000000..f26863e6041d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyMode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes if it is in detection mode or prevention mode at policy level. + */ +public final class PolicyMode extends ExpandableStringEnum { + /** + * Static value Prevention for PolicyMode. + */ + public static final PolicyMode PREVENTION = fromString("Prevention"); + + /** + * Static value Detection for PolicyMode. + */ + public static final PolicyMode DETECTION = fromString("Detection"); + + /** + * Creates a new instance of PolicyMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PolicyMode() { + } + + /** + * Creates or finds a PolicyMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyMode. + */ + public static PolicyMode fromString(String name) { + return fromString(name, PolicyMode.class); + } + + /** + * Gets known PolicyMode values. + * + * @return known PolicyMode values. + */ + public static Collection values() { + return values(PolicyMode.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyResourceState.java new file mode 100644 index 000000000000..be1e2dc2e187 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyResourceState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource status of the policy. + */ +public final class PolicyResourceState extends ExpandableStringEnum { + /** + * Static value Creating for PolicyResourceState. + */ + public static final PolicyResourceState CREATING = fromString("Creating"); + + /** + * Static value Enabling for PolicyResourceState. + */ + public static final PolicyResourceState ENABLING = fromString("Enabling"); + + /** + * Static value Enabled for PolicyResourceState. + */ + public static final PolicyResourceState ENABLED = fromString("Enabled"); + + /** + * Static value Disabling for PolicyResourceState. + */ + public static final PolicyResourceState DISABLING = fromString("Disabling"); + + /** + * Static value Disabled for PolicyResourceState. + */ + public static final PolicyResourceState DISABLED = fromString("Disabled"); + + /** + * Static value Deleting for PolicyResourceState. + */ + public static final PolicyResourceState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of PolicyResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PolicyResourceState() { + } + + /** + * Creates or finds a PolicyResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyResourceState. + */ + public static PolicyResourceState fromString(String name) { + return fromString(name, PolicyResourceState.class); + } + + /** + * Gets known PolicyResourceState values. + * + * @return known PolicyResourceState values. + */ + public static Collection values() { + return values(PolicyResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettings.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettings.java new file mode 100644 index 000000000000..bedc6025be06 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettings.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines contents of a web application firewall global configuration. + */ +@Fluent +public final class PolicySettings implements JsonSerializable { + /* + * describes if the policy is in enabled state or disabled state + */ + private PolicyEnabledState enabledState; + + /* + * Describes if it is in detection mode or prevention mode at policy level. + */ + private PolicyMode mode; + + /* + * If action type is redirect, this field represents the default redirect URL for the client. + */ + private String defaultRedirectUrl; + + /* + * If the action type is block, this field defines the default customer overridable http response status code. + */ + private PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode; + + /* + * If the action type is block, customer can override the response body. The body must be specified in base64 + * encoding. + */ + private String defaultCustomBlockResponseBody; + + /** + * Creates an instance of PolicySettings class. + */ + public PolicySettings() { + } + + /** + * Get the enabledState property: describes if the policy is in enabled state or disabled state. + * + * @return the enabledState value. + */ + public PolicyEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: describes if the policy is in enabled state or disabled state. + * + * @param enabledState the enabledState value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withEnabledState(PolicyEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the mode property: Describes if it is in detection mode or prevention mode at policy level. + * + * @return the mode value. + */ + public PolicyMode mode() { + return this.mode; + } + + /** + * Set the mode property: Describes if it is in detection mode or prevention mode at policy level. + * + * @param mode the mode value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withMode(PolicyMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL + * for the client. + * + * @return the defaultRedirectUrl value. + */ + public String defaultRedirectUrl() { + return this.defaultRedirectUrl; + } + + /** + * Set the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL + * for the client. + * + * @param defaultRedirectUrl the defaultRedirectUrl value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withDefaultRedirectUrl(String defaultRedirectUrl) { + this.defaultRedirectUrl = defaultRedirectUrl; + return this; + } + + /** + * Get the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the + * default customer overridable http response status code. + * + * @return the defaultCustomBlockResponseStatusCode value. + */ + public PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode() { + return this.defaultCustomBlockResponseStatusCode; + } + + /** + * Set the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the + * default customer overridable http response status code. + * + * @param defaultCustomBlockResponseStatusCode the defaultCustomBlockResponseStatusCode value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withDefaultCustomBlockResponseStatusCode( + PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode) { + this.defaultCustomBlockResponseStatusCode = defaultCustomBlockResponseStatusCode; + return this; + } + + /** + * Get the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response + * body. The body must be specified in base64 encoding. + * + * @return the defaultCustomBlockResponseBody value. + */ + public String defaultCustomBlockResponseBody() { + return this.defaultCustomBlockResponseBody; + } + + /** + * Set the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response + * body. The body must be specified in base64 encoding. + * + * @param defaultCustomBlockResponseBody the defaultCustomBlockResponseBody value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withDefaultCustomBlockResponseBody(String defaultCustomBlockResponseBody) { + this.defaultCustomBlockResponseBody = defaultCustomBlockResponseBody; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("enabledState", this.enabledState == null ? null : this.enabledState.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("defaultRedirectUrl", this.defaultRedirectUrl); + jsonWriter.writeNumberField("defaultCustomBlockResponseStatusCode", + this.defaultCustomBlockResponseStatusCode == null + ? null + : this.defaultCustomBlockResponseStatusCode.getValue()); + jsonWriter.writeStringField("defaultCustomBlockResponseBody", this.defaultCustomBlockResponseBody); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PolicySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PolicySettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PolicySettings. + */ + public static PolicySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PolicySettings deserializedPolicySettings = new PolicySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabledState".equals(fieldName)) { + deserializedPolicySettings.enabledState = PolicyEnabledState.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedPolicySettings.mode = PolicyMode.fromString(reader.getString()); + } else if ("defaultRedirectUrl".equals(fieldName)) { + deserializedPolicySettings.defaultRedirectUrl = reader.getString(); + } else if ("defaultCustomBlockResponseStatusCode".equals(fieldName)) { + deserializedPolicySettings.defaultCustomBlockResponseStatusCode + = PolicySettingsDefaultCustomBlockResponseStatusCode.fromValue(reader.getInt()); + } else if ("defaultCustomBlockResponseBody".equals(fieldName)) { + deserializedPolicySettings.defaultCustomBlockResponseBody = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPolicySettings; + }); + } +} 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 000000000000..412cb1dfac6a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettingsDefaultCustomBlockResponseStatusCode.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableEnum; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; + +/** + * If the action type is block, this field defines the default customer overridable http response status code. + */ +public final class PolicySettingsDefaultCustomBlockResponseStatusCode + implements ExpandableEnum, JsonSerializable { + private static final Map VALUES + = new ConcurrentHashMap<>(); + + private static final Function NEW_INSTANCE + = PolicySettingsDefaultCustomBlockResponseStatusCode::new; + + /** + * Static value 200 for PolicySettingsDefaultCustomBlockResponseStatusCode. + */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode TWO_ZERO_ZERO = fromValue(200); + + /** + * Static value 403 for PolicySettingsDefaultCustomBlockResponseStatusCode. + */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode FOUR_ZERO_THREE = fromValue(403); + + /** + * Static value 405 for PolicySettingsDefaultCustomBlockResponseStatusCode. + */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode FOUR_ZERO_FIVE = fromValue(405); + + /** + * Static value 406 for PolicySettingsDefaultCustomBlockResponseStatusCode. + */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode FOUR_ZERO_SIX = fromValue(406); + + /** + * Static value 429 for PolicySettingsDefaultCustomBlockResponseStatusCode. + */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode FOUR_TWO_NINE = fromValue(429); + + private final Integer value; + + private PolicySettingsDefaultCustomBlockResponseStatusCode(Integer value) { + this.value = value; + } + + /** + * Creates or finds a PolicySettingsDefaultCustomBlockResponseStatusCode. + * + * @param value a value to look for. + * @return the corresponding PolicySettingsDefaultCustomBlockResponseStatusCode. + * @throws IllegalArgumentException if value is null. + */ + public static PolicySettingsDefaultCustomBlockResponseStatusCode fromValue(Integer value) { + if (value == null) { + throw new IllegalArgumentException("'value' cannot be null."); + } + return VALUES.computeIfAbsent(value, NEW_INSTANCE); + } + + /** + * Gets known PolicySettingsDefaultCustomBlockResponseStatusCode values. + * + * @return Known PolicySettingsDefaultCustomBlockResponseStatusCode values. + */ + public static Collection values() { + return new ArrayList<>(VALUES.values()); + } + + /** + * Gets the value of the PolicySettingsDefaultCustomBlockResponseStatusCode instance. + * + * @return the value of the PolicySettingsDefaultCustomBlockResponseStatusCode instance. + */ + @Override + public Integer getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + return jsonWriter.writeInt(getValue()); + } + + /** + * Reads an instance of PolicySettingsDefaultCustomBlockResponseStatusCode from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PolicySettingsDefaultCustomBlockResponseStatusCode if the JsonReader was pointing to an + * instance of it, or null if the JsonReader was pointing to JSON null. + * @throws IOException If an error occurs while reading the PolicySettingsDefaultCustomBlockResponseStatusCode. + * @throws IllegalStateException If unexpected JSON token is found. + */ + public static PolicySettingsDefaultCustomBlockResponseStatusCode fromJson(JsonReader jsonReader) + throws IOException { + JsonToken nextToken = jsonReader.nextToken(); + if (nextToken == JsonToken.NULL) { + return null; + } + if (nextToken != JsonToken.NUMBER) { + throw new IllegalStateException( + String.format("Unexpected JSON token for %s deserialization: %s", JsonToken.NUMBER, nextToken)); + } + return PolicySettingsDefaultCustomBlockResponseStatusCode.fromValue(jsonReader.getInt()); + } + + @Override + public String toString() { + return Objects.toString(this.value); + } + + @Override + public boolean equals(Object obj) { + return this == obj; + } + + @Override + public int hashCode() { + return Objects.hashCode(this.value); + } +} 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 000000000000..113d13ddf521 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsMatchConditionParameters.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for PostArgs match conditions. + */ +@Fluent +public final class PostArgsMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_POST_ARGS_CONDITION_PARAMETERS; + + /* + * Name of PostArg to be matched + */ + private String selector; + + /* + * Describes operator to be matched + */ + private PostArgsOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of PostArgsMatchConditionParameters class. + */ + public PostArgsMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model PostArgsMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PostArgsMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("selector", this.selector); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PostArgsMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PostArgsMatchConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PostArgsMatchConditionParameters. + */ + public static PostArgsMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PostArgsMatchConditionParameters deserializedPostArgsMatchConditionParameters + = new PostArgsMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedPostArgsMatchConditionParameters.operator + = PostArgsOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedPostArgsMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("selector".equals(fieldName)) { + deserializedPostArgsMatchConditionParameters.selector = reader.getString(); + } else if ("negateCondition".equals(fieldName)) { + deserializedPostArgsMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedPostArgsMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedPostArgsMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedPostArgsMatchConditionParameters; + }); + } +} 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 000000000000..0e59f4e462e8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class PostArgsOperator extends ExpandableStringEnum { + /** + * Static value Any for PostArgsOperator. + */ + public static final PostArgsOperator ANY = fromString("Any"); + + /** + * Static value Equal for PostArgsOperator. + */ + public static final PostArgsOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for PostArgsOperator. + */ + public static final PostArgsOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for PostArgsOperator. + */ + public static final PostArgsOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for PostArgsOperator. + */ + public static final PostArgsOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for PostArgsOperator. + */ + public static final PostArgsOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for PostArgsOperator. + */ + public static final PostArgsOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for PostArgsOperator. + */ + public static final PostArgsOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for PostArgsOperator. + */ + public static final PostArgsOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for PostArgsOperator. + */ + public static final PostArgsOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of PostArgsOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PostArgsOperator() { + } + + /** + * Creates or finds a PostArgsOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding PostArgsOperator. + */ + public static PostArgsOperator fromString(String name) { + return fromString(name, PostArgsOperator.class); + } + + /** + * Gets known PostArgsOperator values. + * + * @return known PostArgsOperator values. + */ + public static Collection values() { + return values(PostArgsOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PrivateEndpointStatus.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PrivateEndpointStatus.java new file mode 100644 index 000000000000..3fc98ec15b5b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PrivateEndpointStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The approval status for the connection to the Private Link. + */ +public final class PrivateEndpointStatus extends ExpandableStringEnum { + /** + * Static value Pending for PrivateEndpointStatus. + */ + public static final PrivateEndpointStatus PENDING = fromString("Pending"); + + /** + * Static value Approved for PrivateEndpointStatus. + */ + public static final PrivateEndpointStatus APPROVED = fromString("Approved"); + + /** + * Static value Rejected for PrivateEndpointStatus. + */ + public static final PrivateEndpointStatus REJECTED = fromString("Rejected"); + + /** + * Static value Disconnected for PrivateEndpointStatus. + */ + public static final PrivateEndpointStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Static value Timeout for PrivateEndpointStatus. + */ + public static final PrivateEndpointStatus TIMEOUT = fromString("Timeout"); + + /** + * Creates a new instance of PrivateEndpointStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointStatus() { + } + + /** + * Creates or finds a PrivateEndpointStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointStatus. + */ + public static PrivateEndpointStatus fromString(String name) { + return fromString(name, PrivateEndpointStatus.class); + } + + /** + * Gets known PrivateEndpointStatus values. + * + * @return known PrivateEndpointStatus values. + */ + public static Collection values() { + return values(PrivateEndpointStatus.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProbeProtocol.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProbeProtocol.java new file mode 100644 index 000000000000..4441319cc11b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProbeProtocol.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; + +/** + * Protocol to use for health probe. + */ +public enum ProbeProtocol { + /** + * Enum value NotSet. + */ + NOT_SET("NotSet"), + + /** + * Enum value Http. + */ + HTTP("Http"), + + /** + * Enum value Https. + */ + HTTPS("Https"); + + /** + * The actual serialized value for a ProbeProtocol instance. + */ + private final String value; + + ProbeProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProbeProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed ProbeProtocol object, or null if unable to parse. + */ + public static ProbeProtocol fromString(String value) { + if (value == null) { + return null; + } + ProbeProtocol[] items = ProbeProtocol.values(); + for (ProbeProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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 000000000000..e8525abd94b6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profile.java @@ -0,0 +1,553 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import java.util.Map; + +/** + * An immutable client-side representation of Profile. + */ +public interface Profile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature + * list and rate) of the profile. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the kind property: Kind of the profile. Used by portal to differentiate traditional CDN profile and new AFD + * profile. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the resourceState property: Resource status of the profile. + * + * @return the resourceState value. + */ + ProfileResourceState resourceState(); + + /** + * Gets the provisioningState property: Provisioning status of the profile. + * + * @return the provisioningState value. + */ + ProfileProvisioningState provisioningState(); + + /** + * Gets the extendedProperties property: Key-Value pair representing additional properties for profiles. + * + * @return the extendedProperties value. + */ + Map extendedProperties(); + + /** + * Gets the frontDoorId property: The Id of the frontdoor. + * + * @return the frontDoorId value. + */ + String frontDoorId(); + + /** + * Gets the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. + * When timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + Integer originResponseTimeoutSeconds(); + + /** + * Gets the logScrubbing property: Defines rules that scrub sensitive fields in the Azure Front Door profile logs. + * + * @return the logScrubbing value. + */ + ProfileLogScrubbing logScrubbing(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner object. + * + * @return the inner object. + */ + ProfileInner innerModel(); + + /** + * The entirety of the Profile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * The Profile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Profile definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Profile definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Profile definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Profile definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The pricing tier (defines Azure Front Door Standard or Premium or a CDN + * provider, feature list and rate) of the profile.. + * + * @param sku The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature list + * and rate) of the profile. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the Profile definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithOriginResponseTimeoutSeconds, DefinitionStages.WithLogScrubbing { + /** + * Executes the create request. + * + * @return the created resource. + */ + Profile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Profile create(Context context); + } + + /** + * The stage of the Profile definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Profile definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities).. + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the Profile definition allowing to specify 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 Profile definition allowing to specify logScrubbing. + */ + interface WithLogScrubbing { + /** + * Specifies the logScrubbing property: Defines rules that scrub sensitive fields in the Azure Front Door + * profile logs.. + * + * @param logScrubbing Defines rules that scrub sensitive fields in the Azure Front Door profile logs. + * @return the next definition stage. + */ + WithCreate withLogScrubbing(ProfileLogScrubbing logScrubbing); + } + } + + /** + * Begins update for the Profile resource. + * + * @return the stage of resource update. + */ + Profile.Update update(); + + /** + * The template for Profile update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, + UpdateStages.WithOriginResponseTimeoutSeconds, UpdateStages.WithLogScrubbing { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Profile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Profile apply(Context context); + } + + /** + * The Profile update stages. + */ + interface UpdateStages { + /** + * The stage of the Profile update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Profile tags. + * + * @param tags Profile tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Profile update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities).. + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the Profile update allowing to specify originResponseTimeoutSeconds. + */ + interface WithOriginResponseTimeoutSeconds { + /** + * Specifies the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to + * the origin. When timeout is reached, the request fails and returns.. + * + * @param originResponseTimeoutSeconds Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * @return the next definition stage. + */ + Update withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds); + } + + /** + * The stage of the Profile update allowing to specify logScrubbing. + */ + interface WithLogScrubbing { + /** + * Specifies the logScrubbing property: Defines rules to scrub sensitive fields in logs. + * + * @param logScrubbing Defines rules to scrub sensitive fields in logs. + * @return the next definition stage. + */ + Update withLogScrubbing(ProfileLogScrubbing logScrubbing); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Profile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Profile refresh(Context context); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void migrationCommit(); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void migrationCommit(Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response}. + */ + Response generateSsoUriWithResponse(Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal. + */ + SsoUri generateSsoUri(); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response}. + */ + Response listSupportedOptimizationTypesWithResponse(Context context); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile. + */ + SupportedOptimizationTypesListResult listSupportedOptimizationTypes(); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + CanMigrateResult cdnCanMigrateToAfd(); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + CanMigrateResult cdnCanMigrateToAfd(Context context); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + MigrateResult cdnMigrateToAfd(CdnMigrationToAfdParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + MigrateResult cdnMigrateToAfd(CdnMigrationToAfdParameters migrationParameters, Context context); + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @throws com.azure.core.management.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 migrationAbort(); + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 migrationAbort(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileChangeSkuWafMapping.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileChangeSkuWafMapping.java new file mode 100644 index 000000000000..66803f050167 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileChangeSkuWafMapping.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters required for profile upgrade. + */ +@Fluent +public final class ProfileChangeSkuWafMapping implements JsonSerializable { + /* + * The security policy name. + */ + private String securityPolicyName; + + /* + * The new waf resource for the security policy to use. + */ + private ResourceReference changeToWafPolicy; + + /** + * Creates an instance of ProfileChangeSkuWafMapping class. + */ + public ProfileChangeSkuWafMapping() { + } + + /** + * Get the securityPolicyName property: The security policy name. + * + * @return the securityPolicyName value. + */ + public String securityPolicyName() { + return this.securityPolicyName; + } + + /** + * Set the securityPolicyName property: The security policy name. + * + * @param securityPolicyName the securityPolicyName value to set. + * @return the ProfileChangeSkuWafMapping object itself. + */ + public ProfileChangeSkuWafMapping withSecurityPolicyName(String securityPolicyName) { + this.securityPolicyName = securityPolicyName; + return this; + } + + /** + * Get the changeToWafPolicy property: The new waf resource for the security policy to use. + * + * @return the changeToWafPolicy value. + */ + public ResourceReference changeToWafPolicy() { + return this.changeToWafPolicy; + } + + /** + * Set the changeToWafPolicy property: The new waf resource for the security policy to use. + * + * @param changeToWafPolicy the changeToWafPolicy value to set. + * @return the ProfileChangeSkuWafMapping object itself. + */ + public ProfileChangeSkuWafMapping withChangeToWafPolicy(ResourceReference changeToWafPolicy) { + this.changeToWafPolicy = changeToWafPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityPolicyName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property securityPolicyName in model ProfileChangeSkuWafMapping")); + } + if (changeToWafPolicy() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property changeToWafPolicy in model ProfileChangeSkuWafMapping")); + } else { + changeToWafPolicy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProfileChangeSkuWafMapping.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("securityPolicyName", this.securityPolicyName); + jsonWriter.writeJsonField("changeToWafPolicy", this.changeToWafPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProfileChangeSkuWafMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProfileChangeSkuWafMapping if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProfileChangeSkuWafMapping. + */ + public static ProfileChangeSkuWafMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProfileChangeSkuWafMapping deserializedProfileChangeSkuWafMapping = new ProfileChangeSkuWafMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securityPolicyName".equals(fieldName)) { + deserializedProfileChangeSkuWafMapping.securityPolicyName = reader.getString(); + } else if ("changeToWafPolicy".equals(fieldName)) { + deserializedProfileChangeSkuWafMapping.changeToWafPolicy = ResourceReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProfileChangeSkuWafMapping; + }); + } +} 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 000000000000..912f8fdc521e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of CDN profiles within a resource group. + */ + private List value; + + /* + * URL to get the next set of profile objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ProfileListResult class. + */ + public ProfileListResult() { + } + + /** + * Get the value property: List of CDN profiles within a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of profile objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of profile objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ProfileListResult object itself. + */ + public ProfileListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProfileListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProfileListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProfileListResult. + */ + public static ProfileListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProfileListResult deserializedProfileListResult = new ProfileListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ProfileInner.fromJson(reader1)); + deserializedProfileListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedProfileListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProfileListResult; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileLogScrubbing.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileLogScrubbing.java new file mode 100644 index 000000000000..4bba1d446815 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileLogScrubbing.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines rules that scrub sensitive fields in the Azure Front Door profile logs. + */ +@Fluent +public final class ProfileLogScrubbing implements JsonSerializable { + /* + * State of the log scrubbing config. Default value is Enabled. + */ + private ProfileScrubbingState state; + + /* + * List of log scrubbing rules applied to the Azure Front Door profile logs. + */ + private List scrubbingRules; + + /** + * Creates an instance of ProfileLogScrubbing class. + */ + public ProfileLogScrubbing() { + } + + /** + * Get the state property: State of the log scrubbing config. Default value is Enabled. + * + * @return the state value. + */ + public ProfileScrubbingState state() { + return this.state; + } + + /** + * Set the state property: State of the log scrubbing config. Default value is Enabled. + * + * @param state the state value to set. + * @return the ProfileLogScrubbing object itself. + */ + public ProfileLogScrubbing withState(ProfileScrubbingState state) { + this.state = state; + return this; + } + + /** + * Get the scrubbingRules property: List of log scrubbing rules applied to the Azure Front Door profile logs. + * + * @return the scrubbingRules value. + */ + public List scrubbingRules() { + return this.scrubbingRules; + } + + /** + * Set the scrubbingRules property: List of log scrubbing rules applied to the Azure Front Door profile logs. + * + * @param scrubbingRules the scrubbingRules value to set. + * @return the ProfileLogScrubbing object itself. + */ + public ProfileLogScrubbing withScrubbingRules(List scrubbingRules) { + this.scrubbingRules = scrubbingRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scrubbingRules() != null) { + scrubbingRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeArrayField("scrubbingRules", this.scrubbingRules, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProfileLogScrubbing from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProfileLogScrubbing if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProfileLogScrubbing. + */ + public static ProfileLogScrubbing fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProfileLogScrubbing deserializedProfileLogScrubbing = new ProfileLogScrubbing(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedProfileLogScrubbing.state = ProfileScrubbingState.fromString(reader.getString()); + } else if ("scrubbingRules".equals(fieldName)) { + List scrubbingRules + = reader.readArray(reader1 -> ProfileScrubbingRules.fromJson(reader1)); + deserializedProfileLogScrubbing.scrubbingRules = scrubbingRules; + } else { + reader.skipChildren(); + } + } + + return deserializedProfileLogScrubbing; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileProvisioningState.java new file mode 100644 index 000000000000..6c825f268685 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning status of the profile. + */ +public final class ProfileProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProfileProvisioningState. + */ + public static final ProfileProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProfileProvisioningState. + */ + public static final ProfileProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Updating for ProfileProvisioningState. + */ + public static final ProfileProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProfileProvisioningState. + */ + public static final ProfileProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Creating for ProfileProvisioningState. + */ + public static final ProfileProvisioningState CREATING = fromString("Creating"); + + /** + * Creates a new instance of ProfileProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProfileProvisioningState() { + } + + /** + * Creates or finds a ProfileProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProfileProvisioningState. + */ + public static ProfileProvisioningState fromString(String name) { + return fromString(name, ProfileProvisioningState.class); + } + + /** + * Gets known ProfileProvisioningState values. + * + * @return known ProfileProvisioningState values. + */ + public static Collection values() { + return values(ProfileProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileResourceState.java new file mode 100644 index 000000000000..d2cc414a7f78 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileResourceState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource status of the profile. + */ +public final class ProfileResourceState extends ExpandableStringEnum { + /** + * Static value Creating for ProfileResourceState. + */ + public static final ProfileResourceState CREATING = fromString("Creating"); + + /** + * Static value Active for ProfileResourceState. + */ + public static final ProfileResourceState ACTIVE = fromString("Active"); + + /** + * Static value Deleting for ProfileResourceState. + */ + public static final ProfileResourceState DELETING = fromString("Deleting"); + + /** + * Static value Disabled for ProfileResourceState. + */ + public static final ProfileResourceState DISABLED = fromString("Disabled"); + + /** + * Static value Migrating for ProfileResourceState. + */ + public static final ProfileResourceState MIGRATING = fromString("Migrating"); + + /** + * Static value Migrated for ProfileResourceState. + */ + public static final ProfileResourceState MIGRATED = fromString("Migrated"); + + /** + * Static value PendingMigrationCommit for ProfileResourceState. + */ + public static final ProfileResourceState PENDING_MIGRATION_COMMIT = fromString("PendingMigrationCommit"); + + /** + * Static value CommittingMigration for ProfileResourceState. + */ + public static final ProfileResourceState COMMITTING_MIGRATION = fromString("CommittingMigration"); + + /** + * Static value AbortingMigration for ProfileResourceState. + */ + public static final ProfileResourceState ABORTING_MIGRATION = fromString("AbortingMigration"); + + /** + * Creates a new instance of ProfileResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProfileResourceState() { + } + + /** + * Creates or finds a ProfileResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProfileResourceState. + */ + public static ProfileResourceState fromString(String name) { + return fromString(name, ProfileResourceState.class); + } + + /** + * Gets known ProfileResourceState values. + * + * @return known ProfileResourceState values. + */ + public static Collection values() { + return values(ProfileResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileScrubbingRules.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileScrubbingRules.java new file mode 100644 index 000000000000..ec06a9a9e987 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileScrubbingRules.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the contents of the log scrubbing rules. + */ +@Fluent +public final class ProfileScrubbingRules implements JsonSerializable { + /* + * The variable to be scrubbed from the logs. + */ + private ScrubbingRuleEntryMatchVariable matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify which elements in the collection this rule + * applies to. + */ + private ScrubbingRuleEntryMatchOperator selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which elements in the collection this rule applies + * to. + */ + private String selector; + + /* + * Defines the state of a log scrubbing rule. Default value is enabled. + */ + private ScrubbingRuleEntryState state; + + /** + * Creates an instance of ProfileScrubbingRules class. + */ + public ProfileScrubbingRules() { + } + + /** + * Get the matchVariable property: The variable to be scrubbed from the logs. + * + * @return the matchVariable value. + */ + public ScrubbingRuleEntryMatchVariable matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: The variable to be scrubbed from the logs. + * + * @param matchVariable the matchVariable value to set. + * @return the ProfileScrubbingRules object itself. + */ + public ProfileScrubbingRules withMatchVariable(ScrubbingRuleEntryMatchVariable matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this rule applies to. + * + * @return the selectorMatchOperator value. + */ + public ScrubbingRuleEntryMatchOperator selectorMatchOperator() { + return this.selectorMatchOperator; + } + + /** + * Set the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this rule applies to. + * + * @param selectorMatchOperator the selectorMatchOperator value to set. + * @return the ProfileScrubbingRules object itself. + */ + public ProfileScrubbingRules withSelectorMatchOperator(ScrubbingRuleEntryMatchOperator selectorMatchOperator) { + this.selectorMatchOperator = selectorMatchOperator; + return this; + } + + /** + * Get the selector property: When matchVariable is a collection, operator used to specify which elements in the + * collection this rule applies to. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: When matchVariable is a collection, operator used to specify which elements in the + * collection this rule applies to. + * + * @param selector the selector value to set. + * @return the ProfileScrubbingRules object itself. + */ + public ProfileScrubbingRules withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Get the state property: Defines the state of a log scrubbing rule. Default value is enabled. + * + * @return the state value. + */ + public ScrubbingRuleEntryState state() { + return this.state; + } + + /** + * Set the state property: Defines the state of a log scrubbing rule. Default value is enabled. + * + * @param state the state value to set. + * @return the ProfileScrubbingRules object itself. + */ + public ProfileScrubbingRules withState(ScrubbingRuleEntryState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property matchVariable in model ProfileScrubbingRules")); + } + if (selectorMatchOperator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property selectorMatchOperator in model ProfileScrubbingRules")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProfileScrubbingRules.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("matchVariable", this.matchVariable == null ? null : this.matchVariable.toString()); + jsonWriter.writeStringField("selectorMatchOperator", + this.selectorMatchOperator == null ? null : this.selectorMatchOperator.toString()); + jsonWriter.writeStringField("selector", this.selector); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProfileScrubbingRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProfileScrubbingRules if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProfileScrubbingRules. + */ + public static ProfileScrubbingRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProfileScrubbingRules deserializedProfileScrubbingRules = new ProfileScrubbingRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("matchVariable".equals(fieldName)) { + deserializedProfileScrubbingRules.matchVariable + = ScrubbingRuleEntryMatchVariable.fromString(reader.getString()); + } else if ("selectorMatchOperator".equals(fieldName)) { + deserializedProfileScrubbingRules.selectorMatchOperator + = ScrubbingRuleEntryMatchOperator.fromString(reader.getString()); + } else if ("selector".equals(fieldName)) { + deserializedProfileScrubbingRules.selector = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedProfileScrubbingRules.state = ScrubbingRuleEntryState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProfileScrubbingRules; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileScrubbingState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileScrubbingState.java new file mode 100644 index 000000000000..f52735728f9a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileScrubbingState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of the log scrubbing config. Default value is Enabled. + */ +public final class ProfileScrubbingState extends ExpandableStringEnum { + /** + * Static value Enabled for ProfileScrubbingState. + */ + public static final ProfileScrubbingState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for ProfileScrubbingState. + */ + public static final ProfileScrubbingState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ProfileScrubbingState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProfileScrubbingState() { + } + + /** + * Creates or finds a ProfileScrubbingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProfileScrubbingState. + */ + public static ProfileScrubbingState fromString(String name) { + return fromString(name, ProfileScrubbingState.class); + } + + /** + * Gets known ProfileScrubbingState values. + * + * @return known ProfileScrubbingState values. + */ + public static Collection values() { + return values(ProfileScrubbingState.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 000000000000..bd3366303f6a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpdateParameters.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfilePropertiesUpdateParameters; +import java.io.IOException; +import java.util.Map; + +/** + * Properties required to update a profile. + */ +@Fluent +public final class ProfileUpdateParameters implements JsonSerializable { + /* + * Profile tags + */ + private Map tags; + + /* + * Managed service identity (system assigned and/or user assigned identities). + */ + private ManagedServiceIdentity identity; + + /* + * The JSON object containing profile update parameters. + */ + private ProfilePropertiesUpdateParameters innerProperties; + + /** + * Creates an instance of ProfileUpdateParameters class. + */ + public ProfileUpdateParameters() { + } + + /** + * Get the tags property: Profile tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Profile tags. + * + * @param tags the tags value to set. + * @return the ProfileUpdateParameters object itself. + */ + public ProfileUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the ProfileUpdateParameters object itself. + */ + public ProfileUpdateParameters withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The JSON object containing profile update parameters. + * + * @return the innerProperties value. + */ + private ProfilePropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + public Integer originResponseTimeoutSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().originResponseTimeoutSeconds(); + } + + /** + * Set the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @param originResponseTimeoutSeconds the originResponseTimeoutSeconds value to set. + * @return the ProfileUpdateParameters object itself. + */ + public ProfileUpdateParameters withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + if (this.innerProperties() == null) { + this.innerProperties = new ProfilePropertiesUpdateParameters(); + } + this.innerProperties().withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } + + /** + * Get the logScrubbing property: Defines rules to scrub sensitive fields in logs. + * + * @return the logScrubbing value. + */ + public ProfileLogScrubbing logScrubbing() { + return this.innerProperties() == null ? null : this.innerProperties().logScrubbing(); + } + + /** + * Set the logScrubbing property: Defines rules to scrub sensitive fields in logs. + * + * @param logScrubbing the logScrubbing value to set. + * @return the ProfileUpdateParameters object itself. + */ + public ProfileUpdateParameters withLogScrubbing(ProfileLogScrubbing logScrubbing) { + if (this.innerProperties() == null) { + this.innerProperties = new ProfilePropertiesUpdateParameters(); + } + this.innerProperties().withLogScrubbing(logScrubbing); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProfileUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProfileUpdateParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProfileUpdateParameters. + */ + public static ProfileUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProfileUpdateParameters deserializedProfileUpdateParameters = new ProfileUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedProfileUpdateParameters.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedProfileUpdateParameters.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedProfileUpdateParameters.innerProperties + = ProfilePropertiesUpdateParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProfileUpdateParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpgradeParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpgradeParameters.java new file mode 100644 index 000000000000..cb470b2f95fa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpgradeParameters.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters required for profile upgrade. + */ +@Fluent +public final class ProfileUpgradeParameters implements JsonSerializable { + /* + * Web Application Firewall (WAF) and security policy mapping for the profile upgrade + */ + private List wafMappingList; + + /** + * Creates an instance of ProfileUpgradeParameters class. + */ + public ProfileUpgradeParameters() { + } + + /** + * Get the wafMappingList property: Web Application Firewall (WAF) and security policy mapping for the profile + * upgrade. + * + * @return the wafMappingList value. + */ + public List wafMappingList() { + return this.wafMappingList; + } + + /** + * Set the wafMappingList property: Web Application Firewall (WAF) and security policy mapping for the profile + * upgrade. + * + * @param wafMappingList the wafMappingList value to set. + * @return the ProfileUpgradeParameters object itself. + */ + public ProfileUpgradeParameters withWafMappingList(List wafMappingList) { + this.wafMappingList = wafMappingList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (wafMappingList() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property wafMappingList in model ProfileUpgradeParameters")); + } else { + wafMappingList().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProfileUpgradeParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("wafMappingList", this.wafMappingList, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProfileUpgradeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProfileUpgradeParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProfileUpgradeParameters. + */ + public static ProfileUpgradeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProfileUpgradeParameters deserializedProfileUpgradeParameters = new ProfileUpgradeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("wafMappingList".equals(fieldName)) { + List wafMappingList + = reader.readArray(reader1 -> ProfileChangeSkuWafMapping.fromJson(reader1)); + deserializedProfileUpgradeParameters.wafMappingList = wafMappingList; + } else { + reader.skipChildren(); + } + } + + return deserializedProfileUpgradeParameters; + }); + } +} 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 000000000000..5e036617fbc6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profiles.java @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Profiles. + */ +public interface Profiles { + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String profileName, Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + */ + Profile getByResourceGroup(String resourceGroupName, String profileName); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String profileName); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + CanMigrateResult canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + CanMigrateResult canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters, Context context); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + MigrateResult migrate(String resourceGroupName, MigrationParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + MigrateResult migrate(String resourceGroupName, MigrationParameters migrationParameters, Context context); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void migrationCommit(String resourceGroupName, String profileName); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void migrationCommit(String resourceGroupName, String profileName, Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response}. + */ + Response generateSsoUriWithResponse(String resourceGroupName, String profileName, Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal. + */ + SsoUri generateSsoUri(String resourceGroupName, String profileName); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response}. + */ + Response listSupportedOptimizationTypesWithResponse(String resourceGroupName, + String profileName, Context context); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile. + */ + SupportedOptimizationTypesListResult listSupportedOptimizationTypes(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation. + */ + CanMigrateResult cdnCanMigrateToAfd(String resourceGroupName, String profileName); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 for canMigrate operation. + */ + CanMigrateResult cdnCanMigrateToAfd(String resourceGroupName, String profileName, Context context); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + MigrateResult cdnMigrateToAfd(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile for + * migration and will be followed by Commit to finalize the migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + MigrateResult cdnMigrateToAfd(String resourceGroupName, String profileName, + CdnMigrationToAfdParameters migrationParameters, Context context); + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 migrationAbort(String resourceGroupName, String profileName); + + /** + * Abort the migration to Azure Frontdoor Premium/Standard. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium 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 migrationAbort(String resourceGroupName, String profileName, Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + Profile getById(String id); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Profile resource. + * + * @param name resource name. + * @return the first stage of the new Profile definition. + */ + Profile.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProtocolType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProtocolType.java new file mode 100644 index 000000000000..4e089ec34f5f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProtocolType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the TLS extension protocol that is used for secure delivery. + */ +public final class ProtocolType extends ExpandableStringEnum { + /** + * Static value ServerNameIndication for ProtocolType. + */ + public static final ProtocolType SERVER_NAME_INDICATION = fromString("ServerNameIndication"); + + /** + * Static value IPBased for ProtocolType. + */ + public static final ProtocolType IPBASED = fromString("IPBased"); + + /** + * Creates a new instance of ProtocolType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProtocolType() { + } + + /** + * Creates or finds a ProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtocolType. + */ + public static ProtocolType fromString(String name) { + return fromString(name, ProtocolType.class); + } + + /** + * Gets known ProtocolType values. + * + * @return known ProtocolType values. + */ + public static Collection values() { + return values(ProtocolType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProvisioningState.java new file mode 100644 index 000000000000..8faa90e66e70 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the WebApplicationFirewallPolicy. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Creating for ProvisioningState. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PurgeParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PurgeParameters.java new file mode 100644 index 000000000000..632fd92b2bce --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PurgeParameters.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters required for content purge. + */ +@Fluent +public final class PurgeParameters implements JsonSerializable { + /* + * The path to the content to be purged. Can describe a file path or a wild card directory. + */ + private List contentPaths; + + /** + * Creates an instance of PurgeParameters class. + */ + public PurgeParameters() { + } + + /** + * Get the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @return the contentPaths value. + */ + public List contentPaths() { + return this.contentPaths; + } + + /** + * Set the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @param contentPaths the contentPaths value to set. + * @return the PurgeParameters object itself. + */ + public PurgeParameters withContentPaths(List contentPaths) { + this.contentPaths = contentPaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentPaths() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property contentPaths in model PurgeParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PurgeParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("contentPaths", this.contentPaths, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PurgeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PurgeParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PurgeParameters. + */ + public static PurgeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PurgeParameters deserializedPurgeParameters = new PurgeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentPaths".equals(fieldName)) { + List contentPaths = reader.readArray(reader1 -> reader1.getString()); + deserializedPurgeParameters.contentPaths = contentPaths; + } else { + reader.skipChildren(); + } + } + + return deserializedPurgeParameters; + }); + } +} 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 000000000000..4bdbb817338f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringBehavior.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 java.util.Collection; + +/** + * Caching behavior for the requests. + */ +public final class QueryStringBehavior extends ExpandableStringEnum { + /** + * Static value Include for QueryStringBehavior. + */ + public static final QueryStringBehavior INCLUDE = fromString("Include"); + + /** + * Static value IncludeAll for QueryStringBehavior. + */ + public static final QueryStringBehavior INCLUDE_ALL = fromString("IncludeAll"); + + /** + * Static value Exclude for QueryStringBehavior. + */ + public static final QueryStringBehavior EXCLUDE = fromString("Exclude"); + + /** + * Static value ExcludeAll for QueryStringBehavior. + */ + public static final QueryStringBehavior EXCLUDE_ALL = fromString("ExcludeAll"); + + /** + * Creates a new instance of QueryStringBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public QueryStringBehavior() { + } + + /** + * Creates or finds a QueryStringBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding QueryStringBehavior. + */ + public static QueryStringBehavior fromString(String name) { + return fromString(name, QueryStringBehavior.class); + } + + /** + * Gets known QueryStringBehavior values. + * + * @return known QueryStringBehavior values. + */ + public static Collection values() { + return values(QueryStringBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringCachingBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringCachingBehavior.java new file mode 100644 index 000000000000..57da06ac517f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringCachingBehavior.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +/** + * Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass + * caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. + */ +public enum QueryStringCachingBehavior { + /** + * Enum value IgnoreQueryString. + */ + IGNORE_QUERY_STRING("IgnoreQueryString"), + + /** + * Enum value BypassCaching. + */ + BYPASS_CACHING("BypassCaching"), + + /** + * Enum value UseQueryString. + */ + USE_QUERY_STRING("UseQueryString"), + + /** + * Enum value NotSet. + */ + NOT_SET("NotSet"); + + /** + * The actual serialized value for a QueryStringCachingBehavior instance. + */ + private final String value; + + QueryStringCachingBehavior(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a QueryStringCachingBehavior instance. + * + * @param value the serialized value to parse. + * @return the parsed QueryStringCachingBehavior object, or null if unable to parse. + */ + public static QueryStringCachingBehavior fromString(String value) { + if (value == null) { + return null; + } + QueryStringCachingBehavior[] items = QueryStringCachingBehavior.values(); + for (QueryStringCachingBehavior item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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 000000000000..1fecdcbc7b12 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for QueryString match conditions. + */ +@Fluent +public final class QueryStringMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_QUERY_STRING_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private QueryStringOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of QueryStringMatchConditionParameters class. + */ + public QueryStringMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model QueryStringMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(QueryStringMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryStringMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryStringMatchConditionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the QueryStringMatchConditionParameters. + */ + public static QueryStringMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryStringMatchConditionParameters deserializedQueryStringMatchConditionParameters + = new QueryStringMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedQueryStringMatchConditionParameters.operator + = QueryStringOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedQueryStringMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedQueryStringMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedQueryStringMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedQueryStringMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedQueryStringMatchConditionParameters; + }); + } +} 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 000000000000..6834fb32871d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class QueryStringOperator extends ExpandableStringEnum { + /** + * Static value Any for QueryStringOperator. + */ + public static final QueryStringOperator ANY = fromString("Any"); + + /** + * Static value Equal for QueryStringOperator. + */ + public static final QueryStringOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for QueryStringOperator. + */ + public static final QueryStringOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for QueryStringOperator. + */ + public static final QueryStringOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for QueryStringOperator. + */ + public static final QueryStringOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for QueryStringOperator. + */ + public static final QueryStringOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for QueryStringOperator. + */ + public static final QueryStringOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for QueryStringOperator. + */ + public static final QueryStringOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for QueryStringOperator. + */ + public static final QueryStringOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for QueryStringOperator. + */ + public static final QueryStringOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of QueryStringOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public QueryStringOperator() { + } + + /** + * Creates or finds a QueryStringOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding QueryStringOperator. + */ + public static QueryStringOperator fromString(String name) { + return fromString(name, QueryStringOperator.class); + } + + /** + * Gets known QueryStringOperator values. + * + * @return known QueryStringOperator values. + */ + public static Collection values() { + return values(QueryStringOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponse.java new file mode 100644 index 000000000000..48d1f0c4b5dd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponse.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.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 000000000000..8e45d45432d9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesItem.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The RankingsResponseTablesItem model. + */ +@Fluent +public final class RankingsResponseTablesItem implements JsonSerializable { + /* + * The ranking property. + */ + private String ranking; + + /* + * The data property. + */ + private List data; + + /** + * Creates an instance of RankingsResponseTablesItem class. + */ + public RankingsResponseTablesItem() { + } + + /** + * Get the ranking property: The ranking property. + * + * @return the ranking value. + */ + public String ranking() { + return this.ranking; + } + + /** + * Set the ranking property: The ranking property. + * + * @param ranking the ranking value to set. + * @return the RankingsResponseTablesItem object itself. + */ + public RankingsResponseTablesItem withRanking(String ranking) { + this.ranking = ranking; + return this; + } + + /** + * Get the data property: The data property. + * + * @return the data value. + */ + public List data() { + return this.data; + } + + /** + * Set the data property: The data property. + * + * @param data the data value to set. + * @return the RankingsResponseTablesItem object itself. + */ + public RankingsResponseTablesItem withData(List data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (data() != null) { + data().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ranking", this.ranking); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RankingsResponseTablesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RankingsResponseTablesItem if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RankingsResponseTablesItem. + */ + public static RankingsResponseTablesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RankingsResponseTablesItem deserializedRankingsResponseTablesItem = new RankingsResponseTablesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ranking".equals(fieldName)) { + deserializedRankingsResponseTablesItem.ranking = reader.getString(); + } else if ("data".equals(fieldName)) { + List data + = reader.readArray(reader1 -> RankingsResponseTablesPropertiesItemsItem.fromJson(reader1)); + deserializedRankingsResponseTablesItem.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedRankingsResponseTablesItem; + }); + } +} 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 000000000000..8ae07e3804ef --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsItem.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The RankingsResponseTablesPropertiesItemsItem model. + */ +@Fluent +public final class RankingsResponseTablesPropertiesItemsItem + implements JsonSerializable { + /* + * The name property. + */ + private String name; + + /* + * The metrics property. + */ + private List metrics; + + /** + * Creates an instance of RankingsResponseTablesPropertiesItemsItem class. + */ + public RankingsResponseTablesPropertiesItemsItem() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the RankingsResponseTablesPropertiesItemsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the metrics property: The metrics property. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: The metrics property. + * + * @param metrics the metrics value to set. + * @return the RankingsResponseTablesPropertiesItemsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsItem + withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metrics() != null) { + metrics().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("metrics", this.metrics, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RankingsResponseTablesPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RankingsResponseTablesPropertiesItemsItem if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RankingsResponseTablesPropertiesItemsItem. + */ + public static RankingsResponseTablesPropertiesItemsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RankingsResponseTablesPropertiesItemsItem deserializedRankingsResponseTablesPropertiesItemsItem + = new RankingsResponseTablesPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRankingsResponseTablesPropertiesItemsItem.name = reader.getString(); + } else if ("metrics".equals(fieldName)) { + List metrics = reader + .readArray(reader1 -> RankingsResponseTablesPropertiesItemsMetricsItem.fromJson(reader1)); + deserializedRankingsResponseTablesPropertiesItemsItem.metrics = metrics; + } else { + reader.skipChildren(); + } + } + + return deserializedRankingsResponseTablesPropertiesItemsItem; + }); + } +} 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 000000000000..d85731836549 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsMetricsItem.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The RankingsResponseTablesPropertiesItemsMetricsItem model. + */ +@Fluent +public final class RankingsResponseTablesPropertiesItemsMetricsItem + implements JsonSerializable { + /* + * The metric property. + */ + private String metric; + + /* + * The value property. + */ + private Long value; + + /* + * The percentage property. + */ + private Float percentage; + + /** + * Creates an instance of RankingsResponseTablesPropertiesItemsMetricsItem class. + */ + public RankingsResponseTablesPropertiesItemsMetricsItem() { + } + + /** + * Get the metric property: The metric property. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: The metric property. + * + * @param metric the metric value to set. + * @return the RankingsResponseTablesPropertiesItemsMetricsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsMetricsItem withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public Long value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the RankingsResponseTablesPropertiesItemsMetricsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsMetricsItem withValue(Long value) { + this.value = value; + return this; + } + + /** + * Get the percentage property: The percentage property. + * + * @return the percentage value. + */ + public Float percentage() { + return this.percentage; + } + + /** + * Set the percentage property: The percentage property. + * + * @param percentage the percentage value to set. + * @return the RankingsResponseTablesPropertiesItemsMetricsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsMetricsItem withPercentage(Float percentage) { + this.percentage = percentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metric", this.metric); + jsonWriter.writeNumberField("value", this.value); + jsonWriter.writeNumberField("percentage", this.percentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RankingsResponseTablesPropertiesItemsMetricsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RankingsResponseTablesPropertiesItemsMetricsItem if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RankingsResponseTablesPropertiesItemsMetricsItem. + */ + public static RankingsResponseTablesPropertiesItemsMetricsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RankingsResponseTablesPropertiesItemsMetricsItem deserializedRankingsResponseTablesPropertiesItemsMetricsItem + = new RankingsResponseTablesPropertiesItemsMetricsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metric".equals(fieldName)) { + deserializedRankingsResponseTablesPropertiesItemsMetricsItem.metric = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedRankingsResponseTablesPropertiesItemsMetricsItem.value + = reader.getNullable(JsonReader::getLong); + } else if ("percentage".equals(fieldName)) { + deserializedRankingsResponseTablesPropertiesItemsMetricsItem.percentage + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedRankingsResponseTablesPropertiesItemsMetricsItem; + }); + } +} 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 000000000000..c6124729bc70 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRule.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines a rate limiting rule that can be included in a waf policy. + */ +@Fluent +public final class RateLimitRule extends CustomRule { + /* + * Defines rate limit threshold. + */ + private int rateLimitThreshold; + + /* + * Defines rate limit duration. Default is 1 minute. + */ + private int rateLimitDurationInMinutes; + + /** + * Creates an instance of RateLimitRule class. + */ + public RateLimitRule() { + } + + /** + * Get the rateLimitThreshold property: Defines rate limit threshold. + * + * @return the rateLimitThreshold value. + */ + public int rateLimitThreshold() { + return this.rateLimitThreshold; + } + + /** + * Set the rateLimitThreshold property: Defines rate limit threshold. + * + * @param rateLimitThreshold the rateLimitThreshold value to set. + * @return the RateLimitRule object itself. + */ + public RateLimitRule withRateLimitThreshold(int rateLimitThreshold) { + this.rateLimitThreshold = rateLimitThreshold; + return this; + } + + /** + * Get the rateLimitDurationInMinutes property: Defines rate limit duration. Default is 1 minute. + * + * @return the rateLimitDurationInMinutes value. + */ + public int rateLimitDurationInMinutes() { + return this.rateLimitDurationInMinutes; + } + + /** + * Set the rateLimitDurationInMinutes property: Defines rate limit duration. Default is 1 minute. + * + * @param rateLimitDurationInMinutes the rateLimitDurationInMinutes value to set. + * @return the RateLimitRule object itself. + */ + public RateLimitRule withRateLimitDurationInMinutes(int rateLimitDurationInMinutes) { + this.rateLimitDurationInMinutes = rateLimitDurationInMinutes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RateLimitRule withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RateLimitRule withEnabledState(CustomRuleEnabledState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RateLimitRule withPriority(int priority) { + super.withPriority(priority); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RateLimitRule withMatchConditions(List matchConditions) { + super.withMatchConditions(matchConditions); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RateLimitRule withAction(ActionType action) { + super.withAction(action); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model RateLimitRule")); + } + if (matchConditions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property matchConditions in model RateLimitRule")); + } else { + matchConditions().forEach(e -> e.validate()); + } + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model RateLimitRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RateLimitRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeIntField("priority", priority()); + jsonWriter.writeArrayField("matchConditions", matchConditions(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("action", action() == null ? null : action().toString()); + jsonWriter.writeStringField("enabledState", enabledState() == null ? null : enabledState().toString()); + jsonWriter.writeIntField("rateLimitThreshold", this.rateLimitThreshold); + jsonWriter.writeIntField("rateLimitDurationInMinutes", this.rateLimitDurationInMinutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RateLimitRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RateLimitRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RateLimitRule. + */ + public static RateLimitRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RateLimitRule deserializedRateLimitRule = new RateLimitRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRateLimitRule.withName(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedRateLimitRule.withPriority(reader.getInt()); + } else if ("matchConditions".equals(fieldName)) { + List matchConditions + = reader.readArray(reader1 -> MatchCondition.fromJson(reader1)); + deserializedRateLimitRule.withMatchConditions(matchConditions); + } else if ("action".equals(fieldName)) { + deserializedRateLimitRule.withAction(ActionType.fromString(reader.getString())); + } else if ("enabledState".equals(fieldName)) { + deserializedRateLimitRule.withEnabledState(CustomRuleEnabledState.fromString(reader.getString())); + } else if ("rateLimitThreshold".equals(fieldName)) { + deserializedRateLimitRule.rateLimitThreshold = reader.getInt(); + } else if ("rateLimitDurationInMinutes".equals(fieldName)) { + deserializedRateLimitRule.rateLimitDurationInMinutes = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedRateLimitRule; + }); + } +} 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 000000000000..e684c55ed1f0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRuleList.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines contents of rate limit rules. + */ +@Fluent +public final class RateLimitRuleList implements JsonSerializable { + /* + * List of rules + */ + private List rules; + + /** + * Creates an instance of RateLimitRuleList class. + */ + public RateLimitRuleList() { + } + + /** + * Get the rules property: List of rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules. + * + * @param rules the rules value to set. + * @return the RateLimitRuleList object itself. + */ + public RateLimitRuleList withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RateLimitRuleList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RateLimitRuleList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RateLimitRuleList. + */ + public static RateLimitRuleList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RateLimitRuleList deserializedRateLimitRuleList = new RateLimitRuleList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> RateLimitRule.fromJson(reader1)); + deserializedRateLimitRuleList.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedRateLimitRuleList; + }); + } +} 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 000000000000..9b8d90dc3065 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RedirectType.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 java.util.Collection; + +/** + * The redirect type the rule will use when redirecting traffic. + */ +public final class RedirectType extends ExpandableStringEnum { + /** + * Static value Moved for RedirectType. + */ + public static final RedirectType MOVED = fromString("Moved"); + + /** + * Static value Found for RedirectType. + */ + public static final RedirectType FOUND = fromString("Found"); + + /** + * Static value TemporaryRedirect for RedirectType. + */ + public static final RedirectType TEMPORARY_REDIRECT = fromString("TemporaryRedirect"); + + /** + * Static value PermanentRedirect for RedirectType. + */ + public static final RedirectType PERMANENT_REDIRECT = fromString("PermanentRedirect"); + + /** + * Creates a new instance of RedirectType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RedirectType() { + } + + /** + * Creates or finds a RedirectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RedirectType. + */ + public static RedirectType fromString(String name) { + return fromString(name, RedirectType.class); + } + + /** + * Gets known RedirectType values. + * + * @return known RedirectType values. + */ + public static Collection values() { + return values(RedirectType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressMatchConditionParameters.java new file mode 100644 index 000000000000..6435fc4e981f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressMatchConditionParameters.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for RemoteAddress match conditions. + */ +@Fluent +public final class RemoteAddressMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_REMOTE_ADDRESS_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private RemoteAddressOperator operator; + + /* + * Describes if this is negate condition or not + */ + 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. + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of RemoteAddressMatchConditionParameters class. + */ + public RemoteAddressMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model RemoteAddressMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RemoteAddressMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemoteAddressMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemoteAddressMatchConditionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RemoteAddressMatchConditionParameters. + */ + public static RemoteAddressMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RemoteAddressMatchConditionParameters deserializedRemoteAddressMatchConditionParameters + = new RemoteAddressMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedRemoteAddressMatchConditionParameters.operator + = RemoteAddressOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedRemoteAddressMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedRemoteAddressMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedRemoteAddressMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedRemoteAddressMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedRemoteAddressMatchConditionParameters; + }); + } +} 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 000000000000..6b5038f7b81a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressOperator.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class RemoteAddressOperator extends ExpandableStringEnum { + /** + * Static value Any for RemoteAddressOperator. + */ + public static final RemoteAddressOperator ANY = fromString("Any"); + + /** + * Static value IPMatch for RemoteAddressOperator. + */ + public static final RemoteAddressOperator IPMATCH = fromString("IPMatch"); + + /** + * Static value GeoMatch for RemoteAddressOperator. + */ + public static final RemoteAddressOperator GEO_MATCH = fromString("GeoMatch"); + + /** + * Creates a new instance of RemoteAddressOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RemoteAddressOperator() { + } + + /** + * Creates or finds a RemoteAddressOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RemoteAddressOperator. + */ + public static RemoteAddressOperator fromString(String name) { + return fromString(name, RemoteAddressOperator.class); + } + + /** + * Gets known RemoteAddressOperator values. + * + * @return known RemoteAddressOperator values. + */ + public static Collection values() { + return values(RemoteAddressOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyMatchConditionParameters.java new file mode 100644 index 000000000000..839717590373 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for RequestBody match conditions. + */ +@Fluent +public final class RequestBodyMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_BODY_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private RequestBodyOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of RequestBodyMatchConditionParameters class. + */ + public RequestBodyMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model RequestBodyMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestBodyMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RequestBodyMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RequestBodyMatchConditionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RequestBodyMatchConditionParameters. + */ + public static RequestBodyMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RequestBodyMatchConditionParameters deserializedRequestBodyMatchConditionParameters + = new RequestBodyMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedRequestBodyMatchConditionParameters.operator + = RequestBodyOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedRequestBodyMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedRequestBodyMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedRequestBodyMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedRequestBodyMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedRequestBodyMatchConditionParameters; + }); + } +} 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 000000000000..0464ec0c1864 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class RequestBodyOperator extends ExpandableStringEnum { + /** + * Static value Any for RequestBodyOperator. + */ + public static final RequestBodyOperator ANY = fromString("Any"); + + /** + * Static value Equal for RequestBodyOperator. + */ + public static final RequestBodyOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for RequestBodyOperator. + */ + public static final RequestBodyOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for RequestBodyOperator. + */ + public static final RequestBodyOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for RequestBodyOperator. + */ + public static final RequestBodyOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for RequestBodyOperator. + */ + public static final RequestBodyOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for RequestBodyOperator. + */ + public static final RequestBodyOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for RequestBodyOperator. + */ + public static final RequestBodyOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for RequestBodyOperator. + */ + public static final RequestBodyOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for RequestBodyOperator. + */ + public static final RequestBodyOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of RequestBodyOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RequestBodyOperator() { + } + + /** + * Creates or finds a RequestBodyOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestBodyOperator. + */ + public static RequestBodyOperator fromString(String name) { + return fromString(name, RequestBodyOperator.class); + } + + /** + * Gets known RequestBodyOperator values. + * + * @return known RequestBodyOperator values. + */ + public static Collection values() { + return values(RequestBodyOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderMatchConditionParameters.java new file mode 100644 index 000000000000..dd8a79ffd04f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderMatchConditionParameters.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for RequestHeader match conditions. + */ +@Fluent +public final class RequestHeaderMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_HEADER_CONDITION_PARAMETERS; + + /* + * Name of Header to be matched + */ + private String selector; + + /* + * Describes operator to be matched + */ + private RequestHeaderOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of RequestHeaderMatchConditionParameters class. + */ + public RequestHeaderMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model RequestHeaderMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestHeaderMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("selector", this.selector); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RequestHeaderMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RequestHeaderMatchConditionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RequestHeaderMatchConditionParameters. + */ + public static RequestHeaderMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RequestHeaderMatchConditionParameters deserializedRequestHeaderMatchConditionParameters + = new RequestHeaderMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedRequestHeaderMatchConditionParameters.operator + = RequestHeaderOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedRequestHeaderMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("selector".equals(fieldName)) { + deserializedRequestHeaderMatchConditionParameters.selector = reader.getString(); + } else if ("negateCondition".equals(fieldName)) { + deserializedRequestHeaderMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedRequestHeaderMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedRequestHeaderMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedRequestHeaderMatchConditionParameters; + }); + } +} 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 000000000000..5f8b0a3d81ee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class RequestHeaderOperator extends ExpandableStringEnum { + /** + * Static value Any for RequestHeaderOperator. + */ + public static final RequestHeaderOperator ANY = fromString("Any"); + + /** + * Static value Equal for RequestHeaderOperator. + */ + public static final RequestHeaderOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for RequestHeaderOperator. + */ + public static final RequestHeaderOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for RequestHeaderOperator. + */ + public static final RequestHeaderOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for RequestHeaderOperator. + */ + public static final RequestHeaderOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for RequestHeaderOperator. + */ + public static final RequestHeaderOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for RequestHeaderOperator. + */ + public static final RequestHeaderOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for RequestHeaderOperator. + */ + public static final RequestHeaderOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for RequestHeaderOperator. + */ + public static final RequestHeaderOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for RequestHeaderOperator. + */ + public static final RequestHeaderOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of RequestHeaderOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RequestHeaderOperator() { + } + + /** + * Creates or finds a RequestHeaderOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestHeaderOperator. + */ + public static RequestHeaderOperator fromString(String name) { + return fromString(name, RequestHeaderOperator.class); + } + + /** + * Gets known RequestHeaderOperator values. + * + * @return known RequestHeaderOperator values. + */ + public static Collection values() { + return values(RequestHeaderOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParameters.java new file mode 100644 index 000000000000..241ef0e98a09 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParameters.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for RequestMethod match conditions. + */ +@Fluent +public final class RequestMethodMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_METHOD_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private RequestMethodOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * List of transforms + */ + private List transforms; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /** + * Creates an instance of RequestMethodMatchConditionParameters class. + */ + public RequestMethodMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public RequestMethodOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withOperator(RequestMethodOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model RequestMethodMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestMethodMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("matchValues", this.matchValues, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RequestMethodMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RequestMethodMatchConditionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RequestMethodMatchConditionParameters. + */ + public static RequestMethodMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RequestMethodMatchConditionParameters deserializedRequestMethodMatchConditionParameters + = new RequestMethodMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedRequestMethodMatchConditionParameters.operator + = RequestMethodOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedRequestMethodMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedRequestMethodMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedRequestMethodMatchConditionParameters.transforms = transforms; + } else if ("matchValues".equals(fieldName)) { + List matchValues + = reader.readArray(reader1 -> RequestMethodMatchValue.fromString(reader1.getString())); + deserializedRequestMethodMatchConditionParameters.matchValues = matchValues; + } else { + reader.skipChildren(); + } + } + + return deserializedRequestMethodMatchConditionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchValue.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchValue.java new file mode 100644 index 000000000000..130f49e19e96 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchValue.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 java.util.Collection; + +/** + * Defines values for RequestMethodMatchValue. + */ +public final class RequestMethodMatchValue extends ExpandableStringEnum { + /** + * Static value GET for RequestMethodMatchValue. + */ + public static final RequestMethodMatchValue GET = fromString("GET"); + + /** + * Static value HEAD for RequestMethodMatchValue. + */ + public static final RequestMethodMatchValue HEAD = fromString("HEAD"); + + /** + * Static value POST for RequestMethodMatchValue. + */ + public static final RequestMethodMatchValue POST = fromString("POST"); + + /** + * Static value PUT for RequestMethodMatchValue. + */ + public static final RequestMethodMatchValue PUT = fromString("PUT"); + + /** + * Static value DELETE for RequestMethodMatchValue. + */ + public static final RequestMethodMatchValue DELETE = fromString("DELETE"); + + /** + * Static value OPTIONS for RequestMethodMatchValue. + */ + public static final RequestMethodMatchValue OPTIONS = fromString("OPTIONS"); + + /** + * Static value TRACE for RequestMethodMatchValue. + */ + public static final RequestMethodMatchValue TRACE = fromString("TRACE"); + + /** + * Creates a new instance of RequestMethodMatchValue value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RequestMethodMatchValue() { + } + + /** + * Creates or finds a RequestMethodMatchValue from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestMethodMatchValue. + */ + public static RequestMethodMatchValue fromString(String name) { + return fromString(name, RequestMethodMatchValue.class); + } + + /** + * Gets known RequestMethodMatchValue values. + * + * @return known RequestMethodMatchValue values. + */ + public static Collection values() { + return values(RequestMethodMatchValue.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 000000000000..67773d56364a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodOperator.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 java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class RequestMethodOperator extends ExpandableStringEnum { + /** + * Static value Equal for RequestMethodOperator. + */ + public static final RequestMethodOperator EQUAL = fromString("Equal"); + + /** + * Creates a new instance of RequestMethodOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RequestMethodOperator() { + } + + /** + * Creates or finds a RequestMethodOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestMethodOperator. + */ + public static RequestMethodOperator fromString(String name) { + return fromString(name, RequestMethodOperator.class); + } + + /** + * Gets known RequestMethodOperator values. + * + * @return known RequestMethodOperator values. + */ + public static Collection values() { + return values(RequestMethodOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParameters.java new file mode 100644 index 000000000000..4005caea83b0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParameters.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for RequestScheme match conditions. + */ +@Fluent +public final class RequestSchemeMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_SCHEME_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private final String operator = "Equal"; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * List of transforms + */ + private List transforms; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /** + * Creates an instance of RequestSchemeMatchConditionParameters class. + */ + public RequestSchemeMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public String operator() { + return this.operator; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the RequestSchemeMatchConditionParameters object itself. + */ + public RequestSchemeMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the RequestSchemeMatchConditionParameters object itself. + */ + public RequestSchemeMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the RequestSchemeMatchConditionParameters object itself. + */ + public RequestSchemeMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("matchValues", this.matchValues, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RequestSchemeMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RequestSchemeMatchConditionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RequestSchemeMatchConditionParameters. + */ + public static RequestSchemeMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RequestSchemeMatchConditionParameters deserializedRequestSchemeMatchConditionParameters + = new RequestSchemeMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("typeName".equals(fieldName)) { + deserializedRequestSchemeMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedRequestSchemeMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedRequestSchemeMatchConditionParameters.transforms = transforms; + } else if ("matchValues".equals(fieldName)) { + List matchValues + = reader.readArray(reader1 -> RequestSchemeMatchValue.fromString(reader1.getString())); + deserializedRequestSchemeMatchConditionParameters.matchValues = matchValues; + } else { + reader.skipChildren(); + } + } + + return deserializedRequestSchemeMatchConditionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchValue.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchValue.java new file mode 100644 index 000000000000..c50a6e26efe5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchValue.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for RequestSchemeMatchValue. + */ +public final class RequestSchemeMatchValue extends ExpandableStringEnum { + /** + * Static value HTTP for RequestSchemeMatchValue. + */ + public static final RequestSchemeMatchValue HTTP = fromString("HTTP"); + + /** + * Static value HTTPS for RequestSchemeMatchValue. + */ + public static final RequestSchemeMatchValue HTTPS = fromString("HTTPS"); + + /** + * Creates a new instance of RequestSchemeMatchValue value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RequestSchemeMatchValue() { + } + + /** + * Creates or finds a RequestSchemeMatchValue from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestSchemeMatchValue. + */ + public static RequestSchemeMatchValue fromString(String name) { + return fromString(name, RequestSchemeMatchValue.class); + } + + /** + * Gets known RequestSchemeMatchValue values. + * + * @return known RequestSchemeMatchValue values. + */ + public static Collection values() { + return values(RequestSchemeMatchValue.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 000000000000..b7257c82f878 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for RequestUri match conditions. + */ +@Fluent +public final class RequestUriMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_URI_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private RequestUriOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of RequestUriMatchConditionParameters class. + */ + public RequestUriMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model RequestUriMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestUriMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RequestUriMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RequestUriMatchConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RequestUriMatchConditionParameters. + */ + public static RequestUriMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RequestUriMatchConditionParameters deserializedRequestUriMatchConditionParameters + = new RequestUriMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedRequestUriMatchConditionParameters.operator + = RequestUriOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedRequestUriMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedRequestUriMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedRequestUriMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedRequestUriMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedRequestUriMatchConditionParameters; + }); + } +} 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 000000000000..138d2433f054 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class RequestUriOperator extends ExpandableStringEnum { + /** + * Static value Any for RequestUriOperator. + */ + public static final RequestUriOperator ANY = fromString("Any"); + + /** + * Static value Equal for RequestUriOperator. + */ + public static final RequestUriOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for RequestUriOperator. + */ + public static final RequestUriOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for RequestUriOperator. + */ + public static final RequestUriOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for RequestUriOperator. + */ + public static final RequestUriOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for RequestUriOperator. + */ + public static final RequestUriOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for RequestUriOperator. + */ + public static final RequestUriOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for RequestUriOperator. + */ + public static final RequestUriOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for RequestUriOperator. + */ + public static final RequestUriOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for RequestUriOperator. + */ + public static final RequestUriOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of RequestUriOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RequestUriOperator() { + } + + /** + * Creates or finds a RequestUriOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestUriOperator. + */ + public static RequestUriOperator fromString(String name) { + return fromString(name, RequestUriOperator.class); + } + + /** + * Gets known RequestUriOperator values. + * + * @return known RequestUriOperator values. + */ + public static Collection values() { + return values(RequestUriOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceProviders.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceProviders.java new file mode 100644 index 000000000000..2359911cd851 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceProviders.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ResourceProviders. + */ +public interface ResourceProviders { + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + Response checkEndpointNameAvailabilityWithResponse(String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + CheckEndpointNameAvailabilityOutput checkEndpointNameAvailability(String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + CheckNameAvailabilityOutput + checkNameAvailabilityWithSubscription(CheckNameAvailabilityInput checkNameAvailabilityInput); + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API along with {@link Response}. + */ + Response validateProbeWithResponse(ValidateProbeInput validateProbeInput, Context context); + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API. + */ + ValidateProbeOutput validateProbe(ValidateProbeInput validateProbeInput); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceReference.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceReference.java new file mode 100644 index 000000000000..bc7b290962f7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceReference.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Reference to another resource. + */ +@Fluent +public final class ResourceReference implements JsonSerializable { + /* + * Resource ID. + */ + private String id; + + /** + * Creates an instance of ResourceReference class. + */ + public ResourceReference() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ResourceReference object itself. + */ + public ResourceReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceReference. + */ + public static ResourceReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceReference deserializedResourceReference = new ResourceReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourceReference.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceReference; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceType.java new file mode 100644 index 000000000000..4399838c3fe3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceType.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 java.util.Collection; + +/** + * Type of CDN resource used in CheckNameAvailability. + */ +public final class ResourceType extends ExpandableStringEnum { + /** + * Static value Microsoft.Cdn/Profiles/Endpoints for ResourceType. + */ + public static final ResourceType MICROSOFT_CDN_PROFILES_ENDPOINTS = fromString("Microsoft.Cdn/Profiles/Endpoints"); + + /** + * Static value Microsoft.Cdn/Profiles/AfdEndpoints for ResourceType. + */ + public static final ResourceType MICROSOFT_CDN_PROFILES_AFD_ENDPOINTS + = fromString("Microsoft.Cdn/Profiles/AfdEndpoints"); + + /** + * Creates a new instance of ResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceType() { + } + + /** + * Creates or finds a ResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceType. + */ + public static ResourceType fromString(String name) { + return fromString(name, ResourceType.class); + } + + /** + * Gets known ResourceType values. + * + * @return known ResourceType values. + */ + public static Collection values() { + return values(ResourceType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsage.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsage.java new file mode 100644 index 000000000000..fdeba9486288 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsage.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.ResourceUsageInner; + +/** + * An immutable client-side representation of ResourceUsage. + */ +public interface ResourceUsage { + /** + * Gets the resourceType property: Resource type for which the usage is provided. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the unit property: Unit of the usage. e.g. count. + * + * @return the unit value. + */ + ResourceUsageUnit unit(); + + /** + * Gets the currentValue property: Actual value of usage on the specified resource type. + * + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * Gets the limit property: Quota of the specified resource type. + * + * @return the limit value. + */ + Integer limit(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner object. + * + * @return the inner object. + */ + ResourceUsageInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageListResult.java new file mode 100644 index 000000000000..d2544bc04a43 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import java.io.IOException; +import java.util.List; + +/** + * Output of check resource usage API. + */ +@Fluent +public final class ResourceUsageListResult implements JsonSerializable { + /* + * List of resource usages. + */ + private List value; + + /* + * URL to get the next set of custom domain objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ResourceUsageListResult class. + */ + public ResourceUsageListResult() { + } + + /** + * Get the value property: List of resource usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of custom domain objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of custom domain objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ResourceUsageListResult object itself. + */ + public ResourceUsageListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceUsageListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceUsageListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceUsageListResult. + */ + public static ResourceUsageListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceUsageListResult deserializedResourceUsageListResult = new ResourceUsageListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ResourceUsageInner.fromJson(reader1)); + deserializedResourceUsageListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedResourceUsageListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceUsageListResult; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageUnit.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageUnit.java new file mode 100644 index 000000000000..d776bb2ee2c5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageUnit.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 java.util.Collection; + +/** + * Unit of the usage. e.g. count. + */ +public final class ResourceUsageUnit extends ExpandableStringEnum { + /** + * Static value count for ResourceUsageUnit. + */ + public static final ResourceUsageUnit COUNT = fromString("count"); + + /** + * Creates a new instance of ResourceUsageUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceUsageUnit() { + } + + /** + * Creates or finds a ResourceUsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceUsageUnit. + */ + public static ResourceUsageUnit fromString(String name) { + return fromString(name, ResourceUsageUnit.class); + } + + /** + * Gets known ResourceUsageUnit values. + * + * @return known ResourceUsageUnit values. + */ + public static Collection values() { + return values(ResourceUsageUnit.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsages.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsages.java new file mode 100644 index 000000000000..35b5d84a8a46 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsages.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ResourceUsages. + */ +public interface ResourceUsages { + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponse.java new file mode 100644 index 000000000000..978f4ac03c91 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponse.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.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 000000000000..b00358717a02 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseCustomDomainsItem.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ResourcesResponseCustomDomainsItem model. + */ +@Fluent +public final class ResourcesResponseCustomDomainsItem implements JsonSerializable { + /* + * The id property. + */ + private String id; + + /* + * The name property. + */ + private String name; + + /* + * The endpointId property. + */ + private String endpointId; + + /* + * The history property. + */ + private Boolean history; + + /** + * Creates an instance of ResourcesResponseCustomDomainsItem class. + */ + public ResourcesResponseCustomDomainsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ResourcesResponseCustomDomainsItem object itself. + */ + public ResourcesResponseCustomDomainsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the ResourcesResponseCustomDomainsItem object itself. + */ + public ResourcesResponseCustomDomainsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the endpointId property: The endpointId property. + * + * @return the endpointId value. + */ + public String endpointId() { + return this.endpointId; + } + + /** + * Set the endpointId property: The endpointId property. + * + * @param endpointId the endpointId value to set. + * @return the ResourcesResponseCustomDomainsItem object itself. + */ + public ResourcesResponseCustomDomainsItem withEndpointId(String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get the history property: The history property. + * + * @return the history value. + */ + public Boolean history() { + return this.history; + } + + /** + * Set the history property: The history property. + * + * @param history the history value to set. + * @return the ResourcesResponseCustomDomainsItem object itself. + */ + public ResourcesResponseCustomDomainsItem withHistory(Boolean history) { + this.history = history; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("endpointId", this.endpointId); + jsonWriter.writeBooleanField("history", this.history); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourcesResponseCustomDomainsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourcesResponseCustomDomainsItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourcesResponseCustomDomainsItem. + */ + public static ResourcesResponseCustomDomainsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourcesResponseCustomDomainsItem deserializedResourcesResponseCustomDomainsItem + = new ResourcesResponseCustomDomainsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourcesResponseCustomDomainsItem.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedResourcesResponseCustomDomainsItem.name = reader.getString(); + } else if ("endpointId".equals(fieldName)) { + deserializedResourcesResponseCustomDomainsItem.endpointId = reader.getString(); + } else if ("history".equals(fieldName)) { + deserializedResourcesResponseCustomDomainsItem.history = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedResourcesResponseCustomDomainsItem; + }); + } +} 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 000000000000..505f82f1f63c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsItem.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The ResourcesResponseEndpointsItem model. + */ +@Fluent +public final class ResourcesResponseEndpointsItem implements JsonSerializable { + /* + * The id property. + */ + private String id; + + /* + * The name property. + */ + private String name; + + /* + * The history property. + */ + private Boolean history; + + /* + * The customDomains property. + */ + private List customDomains; + + /** + * Creates an instance of ResourcesResponseEndpointsItem class. + */ + public ResourcesResponseEndpointsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ResourcesResponseEndpointsItem object itself. + */ + public ResourcesResponseEndpointsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the ResourcesResponseEndpointsItem object itself. + */ + public ResourcesResponseEndpointsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the history property: The history property. + * + * @return the history value. + */ + public Boolean history() { + return this.history; + } + + /** + * Set the history property: The history property. + * + * @param history the history value to set. + * @return the ResourcesResponseEndpointsItem object itself. + */ + public ResourcesResponseEndpointsItem withHistory(Boolean history) { + this.history = history; + return this; + } + + /** + * Get the customDomains property: The customDomains property. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.customDomains; + } + + /** + * Set the customDomains property: The customDomains property. + * + * @param customDomains the customDomains value to set. + * @return the ResourcesResponseEndpointsItem object itself. + */ + public ResourcesResponseEndpointsItem + withCustomDomains(List customDomains) { + this.customDomains = customDomains; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customDomains() != null) { + customDomains().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("history", this.history); + jsonWriter.writeArrayField("customDomains", this.customDomains, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourcesResponseEndpointsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourcesResponseEndpointsItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourcesResponseEndpointsItem. + */ + public static ResourcesResponseEndpointsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourcesResponseEndpointsItem deserializedResourcesResponseEndpointsItem + = new ResourcesResponseEndpointsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourcesResponseEndpointsItem.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedResourcesResponseEndpointsItem.name = reader.getString(); + } else if ("history".equals(fieldName)) { + deserializedResourcesResponseEndpointsItem.history = reader.getNullable(JsonReader::getBoolean); + } else if ("customDomains".equals(fieldName)) { + List customDomains + = reader.readArray(reader1 -> ResourcesResponseEndpointsPropertiesItemsItem.fromJson(reader1)); + deserializedResourcesResponseEndpointsItem.customDomains = customDomains; + } else { + reader.skipChildren(); + } + } + + return deserializedResourcesResponseEndpointsItem; + }); + } +} 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 000000000000..fa8c7413b2bf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsPropertiesItemsItem.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ResourcesResponseEndpointsPropertiesItemsItem model. + */ +@Fluent +public final class ResourcesResponseEndpointsPropertiesItemsItem + implements JsonSerializable { + /* + * The id property. + */ + private String id; + + /* + * The name property. + */ + private String name; + + /* + * The endpointId property. + */ + private String endpointId; + + /* + * The history property. + */ + private Boolean history; + + /** + * Creates an instance of ResourcesResponseEndpointsPropertiesItemsItem class. + */ + public ResourcesResponseEndpointsPropertiesItemsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ResourcesResponseEndpointsPropertiesItemsItem object itself. + */ + public ResourcesResponseEndpointsPropertiesItemsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the ResourcesResponseEndpointsPropertiesItemsItem object itself. + */ + public ResourcesResponseEndpointsPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the endpointId property: The endpointId property. + * + * @return the endpointId value. + */ + public String endpointId() { + return this.endpointId; + } + + /** + * Set the endpointId property: The endpointId property. + * + * @param endpointId the endpointId value to set. + * @return the ResourcesResponseEndpointsPropertiesItemsItem object itself. + */ + public ResourcesResponseEndpointsPropertiesItemsItem withEndpointId(String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get the history property: The history property. + * + * @return the history value. + */ + public Boolean history() { + return this.history; + } + + /** + * Set the history property: The history property. + * + * @param history the history value to set. + * @return the ResourcesResponseEndpointsPropertiesItemsItem object itself. + */ + public ResourcesResponseEndpointsPropertiesItemsItem withHistory(Boolean history) { + this.history = history; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("endpointId", this.endpointId); + jsonWriter.writeBooleanField("history", this.history); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourcesResponseEndpointsPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourcesResponseEndpointsPropertiesItemsItem if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourcesResponseEndpointsPropertiesItemsItem. + */ + public static ResourcesResponseEndpointsPropertiesItemsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourcesResponseEndpointsPropertiesItemsItem deserializedResourcesResponseEndpointsPropertiesItemsItem + = new ResourcesResponseEndpointsPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourcesResponseEndpointsPropertiesItemsItem.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedResourcesResponseEndpointsPropertiesItemsItem.name = reader.getString(); + } else if ("endpointId".equals(fieldName)) { + deserializedResourcesResponseEndpointsPropertiesItemsItem.endpointId = reader.getString(); + } else if ("history".equals(fieldName)) { + deserializedResourcesResponseEndpointsPropertiesItemsItem.history + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedResourcesResponseEndpointsPropertiesItemsItem; + }); + } +} 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 000000000000..fd3f4dbc9b39 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedDetectedErrorTypes.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; + +/** + * Type of response errors for real user requests for which origin will be deemed unhealthy. + */ +public enum ResponseBasedDetectedErrorTypes { + /** + * Enum value None. + */ + NONE("None"), + + /** + * Enum value TcpErrorsOnly. + */ + TCP_ERRORS_ONLY("TcpErrorsOnly"), + + /** + * Enum value TcpAndHttpErrors. + */ + TCP_AND_HTTP_ERRORS("TcpAndHttpErrors"); + + /** + * The actual serialized value for a ResponseBasedDetectedErrorTypes instance. + */ + private final String value; + + ResponseBasedDetectedErrorTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResponseBasedDetectedErrorTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ResponseBasedDetectedErrorTypes object, or null if unable to parse. + */ + public static ResponseBasedDetectedErrorTypes fromString(String value) { + if (value == null) { + return null; + } + ResponseBasedDetectedErrorTypes[] items = ResponseBasedDetectedErrorTypes.values(); + for (ResponseBasedDetectedErrorTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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 000000000000..6ce662a600d9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedOriginErrorDetectionParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The JSON object that contains the properties to determine origin health using real requests/responses. + */ +@Fluent +public final class ResponseBasedOriginErrorDetectionParameters + implements JsonSerializable { + /* + * Type of response errors for real user requests for which origin will be deemed unhealthy + */ + private ResponseBasedDetectedErrorTypes responseBasedDetectedErrorTypes; + + /* + * The percentage of failed requests in the sample where failover should trigger. + */ + private Integer responseBasedFailoverThresholdPercentage; + + /* + * The list of Http status code ranges that are considered as server errors for origin and it is marked as + * unhealthy. + */ + private List httpErrorRanges; + + /** + * Creates an instance of ResponseBasedOriginErrorDetectionParameters class. + */ + public ResponseBasedOriginErrorDetectionParameters() { + } + + /** + * Get the responseBasedDetectedErrorTypes property: Type of response errors for real user requests for which origin + * will be deemed unhealthy. + * + * @return the responseBasedDetectedErrorTypes value. + */ + public ResponseBasedDetectedErrorTypes responseBasedDetectedErrorTypes() { + return this.responseBasedDetectedErrorTypes; + } + + /** + * Set the responseBasedDetectedErrorTypes property: Type of response errors for real user requests for which origin + * will be deemed unhealthy. + * + * @param responseBasedDetectedErrorTypes the responseBasedDetectedErrorTypes value to set. + * @return the ResponseBasedOriginErrorDetectionParameters object itself. + */ + public ResponseBasedOriginErrorDetectionParameters + withResponseBasedDetectedErrorTypes(ResponseBasedDetectedErrorTypes responseBasedDetectedErrorTypes) { + this.responseBasedDetectedErrorTypes = responseBasedDetectedErrorTypes; + return this; + } + + /** + * Get the responseBasedFailoverThresholdPercentage property: The percentage of failed requests in the sample where + * failover should trigger. + * + * @return the responseBasedFailoverThresholdPercentage value. + */ + public Integer responseBasedFailoverThresholdPercentage() { + return this.responseBasedFailoverThresholdPercentage; + } + + /** + * Set the responseBasedFailoverThresholdPercentage property: The percentage of failed requests in the sample where + * failover should trigger. + * + * @param responseBasedFailoverThresholdPercentage the responseBasedFailoverThresholdPercentage value to set. + * @return the ResponseBasedOriginErrorDetectionParameters object itself. + */ + public ResponseBasedOriginErrorDetectionParameters + withResponseBasedFailoverThresholdPercentage(Integer responseBasedFailoverThresholdPercentage) { + this.responseBasedFailoverThresholdPercentage = responseBasedFailoverThresholdPercentage; + return this; + } + + /** + * Get the httpErrorRanges property: The list of Http status code ranges that are considered as server errors for + * origin and it is marked as unhealthy. + * + * @return the httpErrorRanges value. + */ + public List httpErrorRanges() { + return this.httpErrorRanges; + } + + /** + * Set the httpErrorRanges property: The list of Http status code ranges that are considered as server errors for + * origin and it is marked as unhealthy. + * + * @param httpErrorRanges the httpErrorRanges value to set. + * @return the ResponseBasedOriginErrorDetectionParameters object itself. + */ + public ResponseBasedOriginErrorDetectionParameters + withHttpErrorRanges(List httpErrorRanges) { + this.httpErrorRanges = httpErrorRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (httpErrorRanges() != null) { + httpErrorRanges().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("responseBasedDetectedErrorTypes", + this.responseBasedDetectedErrorTypes == null ? null : this.responseBasedDetectedErrorTypes.toString()); + jsonWriter.writeNumberField("responseBasedFailoverThresholdPercentage", + this.responseBasedFailoverThresholdPercentage); + jsonWriter.writeArrayField("httpErrorRanges", this.httpErrorRanges, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResponseBasedOriginErrorDetectionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResponseBasedOriginErrorDetectionParameters if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResponseBasedOriginErrorDetectionParameters. + */ + public static ResponseBasedOriginErrorDetectionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResponseBasedOriginErrorDetectionParameters deserializedResponseBasedOriginErrorDetectionParameters + = new ResponseBasedOriginErrorDetectionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("responseBasedDetectedErrorTypes".equals(fieldName)) { + deserializedResponseBasedOriginErrorDetectionParameters.responseBasedDetectedErrorTypes + = ResponseBasedDetectedErrorTypes.fromString(reader.getString()); + } else if ("responseBasedFailoverThresholdPercentage".equals(fieldName)) { + deserializedResponseBasedOriginErrorDetectionParameters.responseBasedFailoverThresholdPercentage + = reader.getNullable(JsonReader::getInt); + } else if ("httpErrorRanges".equals(fieldName)) { + List httpErrorRanges + = reader.readArray(reader1 -> HttpErrorRangeParameters.fromJson(reader1)); + deserializedResponseBasedOriginErrorDetectionParameters.httpErrorRanges = httpErrorRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedResponseBasedOriginErrorDetectionParameters; + }); + } +} 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 000000000000..1a816ad07e8b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Route.java @@ -0,0 +1,571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import java.util.List; + +/** + * An immutable client-side representation of Route. + */ +public interface Route { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the endpointName property: The name of the endpoint which holds the route. + * + * @return the endpointName value. + */ + String endpointName(); + + /** + * Gets the customDomains property: Domains referenced by this endpoint. + * + * @return the customDomains value. + */ + List customDomains(); + + /** + * Gets the originGroup property: A reference to the origin group. + * + * @return the originGroup value. + */ + ResourceReference originGroup(); + + /** + * Gets the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content + * from, e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + String originPath(); + + /** + * Gets the ruleSets property: rule sets referenced by this endpoint. + * + * @return the ruleSets value. + */ + List ruleSets(); + + /** + * Gets the supportedProtocols property: List of supported protocols for this route. + * + * @return the supportedProtocols value. + */ + List supportedProtocols(); + + /** + * Gets the patternsToMatch property: The route patterns of the rule. + * + * @return the patternsToMatch value. + */ + List patternsToMatch(); + + /** + * Gets the cacheConfiguration property: The caching configuration for this route. To disable caching, do not + * provide a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + AfdRouteCacheConfiguration cacheConfiguration(); + + /** + * Gets the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + ForwardingProtocol forwardingProtocol(); + + /** + * Gets the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @return the linkToDefaultDomain value. + */ + LinkToDefaultDomain linkToDefaultDomain(); + + /** + * Gets the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @return the httpsRedirect value. + */ + HttpsRedirect httpsRedirect(); + + /** + * Gets the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + EnabledState enabledState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner object. + * + * @return the inner object. + */ + RouteInner innerModel(); + + /** + * The entirety of the Route definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Route definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Route definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Route definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, endpointName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @return the next definition stage. + */ + WithCreate withExistingAfdEndpoint(String resourceGroupName, String profileName, String endpointName); + } + + /** + * The stage of the Route definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithCustomDomains, DefinitionStages.WithOriginGroup, + DefinitionStages.WithOriginPath, DefinitionStages.WithRuleSets, DefinitionStages.WithSupportedProtocols, + DefinitionStages.WithPatternsToMatch, DefinitionStages.WithCacheConfiguration, + DefinitionStages.WithForwardingProtocol, DefinitionStages.WithLinkToDefaultDomain, + DefinitionStages.WithHttpsRedirect, DefinitionStages.WithEnabledState { + /** + * Executes the create request. + * + * @return the created resource. + */ + Route create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Route create(Context context); + } + + /** + * The stage of the Route definition allowing to specify customDomains. + */ + interface WithCustomDomains { + /** + * Specifies the customDomains property: Domains referenced by this endpoint.. + * + * @param customDomains Domains referenced by this endpoint. + * @return the next definition stage. + */ + WithCreate withCustomDomains(List customDomains); + } + + /** + * The stage of the Route definition allowing to specify originGroup. + */ + interface WithOriginGroup { + /** + * Specifies the originGroup property: A reference to the origin group.. + * + * @param originGroup A reference to the origin group. + * @return the next definition stage. + */ + WithCreate withOriginGroup(ResourceReference originGroup); + } + + /** + * The stage of the Route definition allowing to specify originPath. + */ + interface WithOriginPath { + /** + * Specifies the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve + * content from, e.g. contoso.cloudapp.net/originpath.. + * + * @param originPath A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * @return the next definition stage. + */ + WithCreate withOriginPath(String originPath); + } + + /** + * The stage of the Route definition allowing to specify ruleSets. + */ + interface WithRuleSets { + /** + * Specifies the ruleSets property: rule sets referenced by this endpoint.. + * + * @param ruleSets rule sets referenced by this endpoint. + * @return the next definition stage. + */ + WithCreate withRuleSets(List ruleSets); + } + + /** + * The stage of the Route definition allowing to specify supportedProtocols. + */ + interface WithSupportedProtocols { + /** + * Specifies the supportedProtocols property: List of supported protocols for this route.. + * + * @param supportedProtocols List of supported protocols for this route. + * @return the next definition stage. + */ + WithCreate withSupportedProtocols(List supportedProtocols); + } + + /** + * The stage of the Route definition allowing to specify patternsToMatch. + */ + interface WithPatternsToMatch { + /** + * Specifies the patternsToMatch property: The route patterns of the rule.. + * + * @param patternsToMatch The route patterns of the rule. + * @return the next definition stage. + */ + WithCreate withPatternsToMatch(List patternsToMatch); + } + + /** + * The stage of the Route definition allowing to specify cacheConfiguration. + */ + interface WithCacheConfiguration { + /** + * Specifies the cacheConfiguration property: The caching configuration for this route. To disable caching, + * do not provide a cacheConfiguration object.. + * + * @param cacheConfiguration The caching configuration for this route. To disable caching, do not provide a + * cacheConfiguration object. + * @return the next definition stage. + */ + WithCreate withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration); + } + + /** + * The stage of the Route definition allowing to specify forwardingProtocol. + */ + interface WithForwardingProtocol { + /** + * Specifies the forwardingProtocol property: Protocol this rule will use when forwarding traffic to + * backends.. + * + * @param forwardingProtocol Protocol this rule will use when forwarding traffic to backends. + * @return the next definition stage. + */ + WithCreate withForwardingProtocol(ForwardingProtocol forwardingProtocol); + } + + /** + * The stage of the Route definition allowing to specify linkToDefaultDomain. + */ + interface WithLinkToDefaultDomain { + /** + * Specifies the linkToDefaultDomain property: whether this route will be linked to the default endpoint + * domain.. + * + * @param linkToDefaultDomain whether this route will be linked to the default endpoint domain. + * @return the next definition stage. + */ + WithCreate withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain); + } + + /** + * The stage of the Route definition allowing to specify httpsRedirect. + */ + interface WithHttpsRedirect { + /** + * Specifies the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. + * Note that this is a easy way to set up this rule and it will be the first rule that gets executed.. + * + * @param httpsRedirect Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a + * easy way to set up this rule and it will be the first rule that gets executed. + * @return the next definition stage. + */ + WithCreate withHttpsRedirect(HttpsRedirect httpsRedirect); + } + + /** + * The stage of the Route definition allowing to specify enabledState. + */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + WithCreate withEnabledState(EnabledState enabledState); + } + } + + /** + * Begins update for the Route resource. + * + * @return the stage of resource update. + */ + Route.Update update(); + + /** + * The template for Route update. + */ + interface Update extends UpdateStages.WithCustomDomains, UpdateStages.WithOriginGroup, UpdateStages.WithOriginPath, + UpdateStages.WithRuleSets, UpdateStages.WithSupportedProtocols, UpdateStages.WithPatternsToMatch, + UpdateStages.WithCacheConfiguration, UpdateStages.WithForwardingProtocol, UpdateStages.WithLinkToDefaultDomain, + UpdateStages.WithHttpsRedirect, UpdateStages.WithEnabledState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Route apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Route apply(Context context); + } + + /** + * The Route update stages. + */ + interface UpdateStages { + /** + * The stage of the Route update allowing to specify customDomains. + */ + interface WithCustomDomains { + /** + * Specifies the customDomains property: Domains referenced by this endpoint.. + * + * @param customDomains Domains referenced by this endpoint. + * @return the next definition stage. + */ + Update withCustomDomains(List customDomains); + } + + /** + * The stage of the Route update allowing to specify originGroup. + */ + interface WithOriginGroup { + /** + * Specifies the originGroup property: A reference to the origin group.. + * + * @param originGroup A reference to the origin group. + * @return the next definition stage. + */ + Update withOriginGroup(ResourceReference originGroup); + } + + /** + * The stage of the Route update allowing to specify originPath. + */ + interface WithOriginPath { + /** + * Specifies the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve + * content from, e.g. contoso.cloudapp.net/originpath.. + * + * @param originPath A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * @return the next definition stage. + */ + Update withOriginPath(String originPath); + } + + /** + * The stage of the Route update allowing to specify ruleSets. + */ + interface WithRuleSets { + /** + * Specifies the ruleSets property: rule sets referenced by this endpoint.. + * + * @param ruleSets rule sets referenced by this endpoint. + * @return the next definition stage. + */ + Update withRuleSets(List ruleSets); + } + + /** + * The stage of the Route update allowing to specify supportedProtocols. + */ + interface WithSupportedProtocols { + /** + * Specifies the supportedProtocols property: List of supported protocols for this route.. + * + * @param supportedProtocols List of supported protocols for this route. + * @return the next definition stage. + */ + Update withSupportedProtocols(List supportedProtocols); + } + + /** + * The stage of the Route update allowing to specify patternsToMatch. + */ + interface WithPatternsToMatch { + /** + * Specifies the patternsToMatch property: The route patterns of the rule.. + * + * @param patternsToMatch The route patterns of the rule. + * @return the next definition stage. + */ + Update withPatternsToMatch(List patternsToMatch); + } + + /** + * The stage of the Route update allowing to specify cacheConfiguration. + */ + interface WithCacheConfiguration { + /** + * Specifies the cacheConfiguration property: The caching configuration for this route. To disable caching, + * do not provide a cacheConfiguration object.. + * + * @param cacheConfiguration The caching configuration for this route. To disable caching, do not provide a + * cacheConfiguration object. + * @return the next definition stage. + */ + Update withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration); + } + + /** + * The stage of the Route update allowing to specify forwardingProtocol. + */ + interface WithForwardingProtocol { + /** + * Specifies the forwardingProtocol property: Protocol this rule will use when forwarding traffic to + * backends.. + * + * @param forwardingProtocol Protocol this rule will use when forwarding traffic to backends. + * @return the next definition stage. + */ + Update withForwardingProtocol(ForwardingProtocol forwardingProtocol); + } + + /** + * The stage of the Route update allowing to specify linkToDefaultDomain. + */ + interface WithLinkToDefaultDomain { + /** + * Specifies the linkToDefaultDomain property: whether this route will be linked to the default endpoint + * domain.. + * + * @param linkToDefaultDomain whether this route will be linked to the default endpoint domain. + * @return the next definition stage. + */ + Update withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain); + } + + /** + * The stage of the Route update allowing to specify httpsRedirect. + */ + interface WithHttpsRedirect { + /** + * Specifies the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. + * Note that this is a easy way to set up this rule and it will be the first rule that gets executed.. + * + * @param httpsRedirect Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a + * easy way to set up this rule and it will be the first rule that gets executed. + * @return the next definition stage. + */ + Update withHttpsRedirect(HttpsRedirect httpsRedirect); + } + + /** + * The stage of the Route update allowing to specify enabledState. + */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + Update withEnabledState(EnabledState enabledState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Route refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Route refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteConfigurationOverrideActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteConfigurationOverrideActionParameters.java new file mode 100644 index 000000000000..e1f10b1322eb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteConfigurationOverrideActionParameters.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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for the route configuration override action. + */ +@Fluent +public final class RouteConfigurationOverrideActionParameters extends DeliveryRuleActionParameters { + /* + * The typeName property. + */ + private DeliveryRuleActionParametersType typeName + = DeliveryRuleActionParametersType.DELIVERY_RULE_ROUTE_CONFIGURATION_OVERRIDE_ACTION_PARAMETERS; + + /* + * A reference to the origin group override configuration. Leave empty to use the default origin group on route. + */ + private OriginGroupOverride originGroupOverride; + + /* + * The caching configuration associated with this rule. To disable caching, do not provide a cacheConfiguration + * object. + */ + private CacheConfiguration cacheConfiguration; + + /** + * Creates an instance of RouteConfigurationOverrideActionParameters class. + */ + public RouteConfigurationOverrideActionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleActionParametersType typeName() { + return this.typeName; + } + + /** + * Get the originGroupOverride property: A reference to the origin group override configuration. Leave empty to use + * the default origin group on route. + * + * @return the originGroupOverride value. + */ + public OriginGroupOverride originGroupOverride() { + return this.originGroupOverride; + } + + /** + * Set the originGroupOverride property: A reference to the origin group override configuration. Leave empty to use + * the default origin group on route. + * + * @param originGroupOverride the originGroupOverride value to set. + * @return the RouteConfigurationOverrideActionParameters object itself. + */ + public RouteConfigurationOverrideActionParameters withOriginGroupOverride(OriginGroupOverride originGroupOverride) { + this.originGroupOverride = originGroupOverride; + return this; + } + + /** + * Get the cacheConfiguration property: The caching configuration associated with this rule. To disable caching, do + * not provide a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + public CacheConfiguration cacheConfiguration() { + return this.cacheConfiguration; + } + + /** + * Set the cacheConfiguration property: The caching configuration associated with this rule. To disable caching, do + * not provide a cacheConfiguration object. + * + * @param cacheConfiguration the cacheConfiguration value to set. + * @return the RouteConfigurationOverrideActionParameters object itself. + */ + public RouteConfigurationOverrideActionParameters withCacheConfiguration(CacheConfiguration cacheConfiguration) { + this.cacheConfiguration = cacheConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (originGroupOverride() != null) { + originGroupOverride().validate(); + } + if (cacheConfiguration() != null) { + cacheConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeJsonField("originGroupOverride", this.originGroupOverride); + jsonWriter.writeJsonField("cacheConfiguration", this.cacheConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteConfigurationOverrideActionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteConfigurationOverrideActionParameters if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteConfigurationOverrideActionParameters. + */ + public static RouteConfigurationOverrideActionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteConfigurationOverrideActionParameters deserializedRouteConfigurationOverrideActionParameters + = new RouteConfigurationOverrideActionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("typeName".equals(fieldName)) { + deserializedRouteConfigurationOverrideActionParameters.typeName + = DeliveryRuleActionParametersType.fromString(reader.getString()); + } else if ("originGroupOverride".equals(fieldName)) { + deserializedRouteConfigurationOverrideActionParameters.originGroupOverride + = OriginGroupOverride.fromJson(reader); + } else if ("cacheConfiguration".equals(fieldName)) { + deserializedRouteConfigurationOverrideActionParameters.cacheConfiguration + = CacheConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteConfigurationOverrideActionParameters; + }); + } +} 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 000000000000..4835ba8678d9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of AzureFrontDoor routes within a profile. + */ + private List value; + + /* + * URL to get the next set of route objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of RouteListResult class. + */ + public RouteListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor routes within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of route objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of route objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the RouteListResult object itself. + */ + public RouteListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteListResult. + */ + public static RouteListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteListResult deserializedRouteListResult = new RouteListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RouteInner.fromJson(reader1)); + deserializedRouteListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRouteListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteListResult; + }); + } +} 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 000000000000..b37e04b05d31 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdateParameters.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteUpdatePropertiesParameters; +import java.io.IOException; +import java.util.List; + +/** + * The domain JSON object required for domain creation or update. + */ +@Fluent +public final class RouteUpdateParameters implements JsonSerializable { + /* + * The JSON object that contains the properties of the domain to create. + */ + private RouteUpdatePropertiesParameters innerProperties; + + /** + * Creates an instance of RouteUpdateParameters class. + */ + public RouteUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the domain to create. + * + * @return the innerProperties value. + */ + private RouteUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the endpointName property: The name of the endpoint which holds the route. + * + * @return the endpointName value. + */ + public String endpointName() { + return this.innerProperties() == null ? null : this.innerProperties().endpointName(); + } + + /** + * Get the customDomains property: Domains referenced by this endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.innerProperties() == null ? null : this.innerProperties().customDomains(); + } + + /** + * Set the customDomains property: Domains referenced by this endpoint. + * + * @param customDomains the customDomains value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withCustomDomains(List customDomains) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withCustomDomains(customDomains); + return this; + } + + /** + * Get the originGroup property: A reference to the origin group. + * + * @return the originGroup value. + */ + public ResourceReference originGroup() { + return this.innerProperties() == null ? null : this.innerProperties().originGroup(); + } + + /** + * Set the originGroup property: A reference to the origin group. + * + * @param originGroup the originGroup value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withOriginGroup(ResourceReference originGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withOriginGroup(originGroup); + return this; + } + + /** + * Get the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.innerProperties() == null ? null : this.innerProperties().originPath(); + } + + /** + * Set the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withOriginPath(String originPath) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withOriginPath(originPath); + return this; + } + + /** + * Get the ruleSets property: rule sets referenced by this endpoint. + * + * @return the ruleSets value. + */ + public List ruleSets() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSets(); + } + + /** + * Set the ruleSets property: rule sets referenced by this endpoint. + * + * @param ruleSets the ruleSets value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withRuleSets(List ruleSets) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withRuleSets(ruleSets); + return this; + } + + /** + * Get the supportedProtocols property: List of supported protocols for this route. + * + * @return the supportedProtocols value. + */ + public List supportedProtocols() { + return this.innerProperties() == null ? null : this.innerProperties().supportedProtocols(); + } + + /** + * Set the supportedProtocols property: List of supported protocols for this route. + * + * @param supportedProtocols the supportedProtocols value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withSupportedProtocols(List supportedProtocols) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withSupportedProtocols(supportedProtocols); + return this; + } + + /** + * Get the patternsToMatch property: The route patterns of the rule. + * + * @return the patternsToMatch value. + */ + public List patternsToMatch() { + return this.innerProperties() == null ? null : this.innerProperties().patternsToMatch(); + } + + /** + * Set the patternsToMatch property: The route patterns of the rule. + * + * @param patternsToMatch the patternsToMatch value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withPatternsToMatch(List patternsToMatch) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withPatternsToMatch(patternsToMatch); + return this; + } + + /** + * Get the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + public AfdRouteCacheConfiguration cacheConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().cacheConfiguration(); + } + + /** + * Set the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @param cacheConfiguration the cacheConfiguration value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withCacheConfiguration(cacheConfiguration); + return this; + } + + /** + * Get the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + public ForwardingProtocol forwardingProtocol() { + return this.innerProperties() == null ? null : this.innerProperties().forwardingProtocol(); + } + + /** + * Set the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @param forwardingProtocol the forwardingProtocol value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withForwardingProtocol(forwardingProtocol); + return this; + } + + /** + * Get the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @return the linkToDefaultDomain value. + */ + public LinkToDefaultDomain linkToDefaultDomain() { + return this.innerProperties() == null ? null : this.innerProperties().linkToDefaultDomain(); + } + + /** + * Set the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @param linkToDefaultDomain the linkToDefaultDomain value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } + + /** + * Get the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @return the httpsRedirect value. + */ + public HttpsRedirect httpsRedirect() { + return this.innerProperties() == null ? null : this.innerProperties().httpsRedirect(); + } + + /** + * Set the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @param httpsRedirect the httpsRedirect value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withHttpsRedirect(HttpsRedirect httpsRedirect) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withHttpsRedirect(httpsRedirect); + return this; + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteUpdateParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteUpdateParameters. + */ + public static RouteUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteUpdateParameters deserializedRouteUpdateParameters = new RouteUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedRouteUpdateParameters.innerProperties + = RouteUpdatePropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteUpdateParameters; + }); + } +} 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 000000000000..ecf691a65c0c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Routes.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Routes. + */ +public interface Routes { + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName, + Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String endpointName, String routeName, + Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + */ + Route get(String resourceGroupName, String profileName, String endpointName, String routeName); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName, String routeName); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String endpointName, String routeName, Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + Route getById(String id); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Route resource. + * + * @param name resource name. + * @return the first stage of the new Route definition. + */ + Route.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rule.java new file mode 100644 index 000000000000..d43656f84b32 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rule.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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import java.util.List; + +/** + * An immutable client-side representation of Rule. + */ +public interface Rule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the ruleSetName property: The name of the rule set containing the rule. + * + * @return the ruleSetName value. + */ + String ruleSetName(); + + /** + * Gets the order property: The order in which the rules are applied for the endpoint. Possible values + * {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 + * is a special rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value. + */ + Integer order(); + + /** + * Gets the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value. + */ + List conditions(); + + /** + * Gets the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @return the matchProcessingBehavior value. + */ + MatchProcessingBehavior matchProcessingBehavior(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner object. + * + * @return the inner object. + */ + RuleInner innerModel(); + + /** + * The entirety of the Rule definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Rule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Rule definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Rule definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, ruleSetName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @return the next definition stage. + */ + WithCreate withExistingRuleSet(String resourceGroupName, String profileName, String ruleSetName); + } + + /** + * The stage of the Rule definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithOrder, DefinitionStages.WithConditions, + DefinitionStages.WithActions, DefinitionStages.WithMatchProcessingBehavior { + /** + * Executes the create request. + * + * @return the created resource. + */ + Rule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Rule create(Context context); + } + + /** + * The stage of the Rule definition allowing to specify order. + */ + interface WithOrder { + /** + * Specifies the order property: The order in which the rules are applied for the endpoint. Possible values + * {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with + * order 0 is a special rule. It does not require any condition and actions listed in it will always be + * applied.. + * + * @param order The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A + * rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a + * special rule. It does not require any condition and actions listed in it will always be applied. + * @return the next definition stage. + */ + WithCreate withOrder(Integer order); + } + + /** + * The stage of the Rule definition allowing to specify conditions. + */ + interface WithConditions { + /** + * Specifies the conditions property: A list of conditions that must be matched for the actions to be + * executed. + * + * @param conditions A list of conditions that must be matched for the actions to be executed. + * @return the next definition stage. + */ + WithCreate withConditions(List conditions); + } + + /** + * The stage of the Rule definition allowing to specify actions. + */ + interface WithActions { + /** + * Specifies the actions property: A list of actions that are executed when all the conditions of a rule are + * satisfied.. + * + * @param actions A list of actions that are executed when all the conditions of a rule are satisfied. + * @return the next definition stage. + */ + WithCreate withActions(List actions); + } + + /** + * The stage of the Rule definition allowing to specify matchProcessingBehavior. + */ + interface WithMatchProcessingBehavior { + /** + * Specifies the matchProcessingBehavior property: If this rule is a match should the rules engine continue + * running the remaining rules or stop. If not present, defaults to Continue.. + * + * @param matchProcessingBehavior If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * @return the next definition stage. + */ + WithCreate withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior); + } + } + + /** + * Begins update for the Rule resource. + * + * @return the stage of resource update. + */ + Rule.Update update(); + + /** + * The template for Rule update. + */ + interface Update extends UpdateStages.WithOrder, UpdateStages.WithConditions, UpdateStages.WithActions, + UpdateStages.WithMatchProcessingBehavior { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Rule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Rule apply(Context context); + } + + /** + * The Rule update stages. + */ + interface UpdateStages { + /** + * The stage of the Rule update allowing to specify order. + */ + interface WithOrder { + /** + * Specifies the order property: The order in which the rules are applied for the endpoint. Possible values + * {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with + * order 0 is a special rule. It does not require any condition and actions listed in it will always be + * applied.. + * + * @param order The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A + * rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a + * special rule. It does not require any condition and actions listed in it will always be applied. + * @return the next definition stage. + */ + Update withOrder(Integer order); + } + + /** + * The stage of the Rule update allowing to specify conditions. + */ + interface WithConditions { + /** + * Specifies the conditions property: A list of conditions that must be matched for the actions to be + * executed. + * + * @param conditions A list of conditions that must be matched for the actions to be executed. + * @return the next definition stage. + */ + Update withConditions(List conditions); + } + + /** + * The stage of the Rule update allowing to specify actions. + */ + interface WithActions { + /** + * Specifies the actions property: A list of actions that are executed when all the conditions of a rule are + * satisfied.. + * + * @param actions A list of actions that are executed when all the conditions of a rule are satisfied. + * @return the next definition stage. + */ + Update withActions(List actions); + } + + /** + * The stage of the Rule update allowing to specify matchProcessingBehavior. + */ + interface WithMatchProcessingBehavior { + /** + * Specifies the matchProcessingBehavior property: If this rule is a match should the rules engine continue + * running the remaining rules or stop. If not present, defaults to Continue.. + * + * @param matchProcessingBehavior If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * @return the next definition stage. + */ + Update withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Rule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Rule refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleCacheBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleCacheBehavior.java new file mode 100644 index 000000000000..952dd15fe9cd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleCacheBehavior.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Caching behavior for the requests. + */ +public final class RuleCacheBehavior extends ExpandableStringEnum { + /** + * Static value HonorOrigin for RuleCacheBehavior. + */ + public static final RuleCacheBehavior HONOR_ORIGIN = fromString("HonorOrigin"); + + /** + * Static value OverrideAlways for RuleCacheBehavior. + */ + public static final RuleCacheBehavior OVERRIDE_ALWAYS = fromString("OverrideAlways"); + + /** + * Static value OverrideIfOriginMissing for RuleCacheBehavior. + */ + public static final RuleCacheBehavior OVERRIDE_IF_ORIGIN_MISSING = fromString("OverrideIfOriginMissing"); + + /** + * Creates a new instance of RuleCacheBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleCacheBehavior() { + } + + /** + * Creates or finds a RuleCacheBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleCacheBehavior. + */ + public static RuleCacheBehavior fromString(String name) { + return fromString(name, RuleCacheBehavior.class); + } + + /** + * Gets known RuleCacheBehavior values. + * + * @return known RuleCacheBehavior values. + */ + public static Collection values() { + return values(RuleCacheBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleIsCompressionEnabled.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleIsCompressionEnabled.java new file mode 100644 index 000000000000..b96f6690f53a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleIsCompressionEnabled.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether content compression is enabled. If compression is enabled, content will be served as compressed if + * user requests for a compressed version. Content won't be compressed on AzureFrontDoor when requested content is + * smaller than 1 byte or larger than 1 MB. + */ +public final class RuleIsCompressionEnabled extends ExpandableStringEnum { + /** + * Static value Enabled for RuleIsCompressionEnabled. + */ + public static final RuleIsCompressionEnabled ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for RuleIsCompressionEnabled. + */ + public static final RuleIsCompressionEnabled DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of RuleIsCompressionEnabled value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleIsCompressionEnabled() { + } + + /** + * Creates or finds a RuleIsCompressionEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleIsCompressionEnabled. + */ + public static RuleIsCompressionEnabled fromString(String name) { + return fromString(name, RuleIsCompressionEnabled.class); + } + + /** + * Gets known RuleIsCompressionEnabled values. + * + * @return known RuleIsCompressionEnabled values. + */ + public static Collection values() { + return values(RuleIsCompressionEnabled.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleListResult.java new file mode 100644 index 000000000000..f7e4d48b0a5d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of AzureFrontDoor rules within a rule set. + */ + private List value; + + /* + * URL to get the next set of rule objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of RuleListResult class. + */ + public RuleListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor rules within a rule set. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of rule objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of rule objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the RuleListResult object itself. + */ + public RuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleListResult. + */ + public static RuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleListResult deserializedRuleListResult = new RuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RuleInner.fromJson(reader1)); + deserializedRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleListResult; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleQueryStringCachingBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleQueryStringCachingBehavior.java new file mode 100644 index 000000000000..b50132883047 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleQueryStringCachingBehavior.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 java.util.Collection; + +/** + * Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, + * ignore specific query strings, cache every request with a unique URL, or cache specific query strings. + */ +public final class RuleQueryStringCachingBehavior extends ExpandableStringEnum { + /** + * Static value IgnoreQueryString for RuleQueryStringCachingBehavior. + */ + public static final RuleQueryStringCachingBehavior IGNORE_QUERY_STRING = fromString("IgnoreQueryString"); + + /** + * Static value UseQueryString for RuleQueryStringCachingBehavior. + */ + public static final RuleQueryStringCachingBehavior USE_QUERY_STRING = fromString("UseQueryString"); + + /** + * Static value IgnoreSpecifiedQueryStrings for RuleQueryStringCachingBehavior. + */ + public static final RuleQueryStringCachingBehavior IGNORE_SPECIFIED_QUERY_STRINGS + = fromString("IgnoreSpecifiedQueryStrings"); + + /** + * Static value IncludeSpecifiedQueryStrings for RuleQueryStringCachingBehavior. + */ + public static final RuleQueryStringCachingBehavior INCLUDE_SPECIFIED_QUERY_STRINGS + = fromString("IncludeSpecifiedQueryStrings"); + + /** + * Creates a new instance of RuleQueryStringCachingBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleQueryStringCachingBehavior() { + } + + /** + * Creates or finds a RuleQueryStringCachingBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleQueryStringCachingBehavior. + */ + public static RuleQueryStringCachingBehavior fromString(String name) { + return fromString(name, RuleQueryStringCachingBehavior.class); + } + + /** + * Gets known RuleQueryStringCachingBehavior values. + * + * @return known RuleQueryStringCachingBehavior values. + */ + public static Collection values() { + return values(RuleQueryStringCachingBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSet.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSet.java new file mode 100644 index 000000000000..7e88fe1df316 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSet.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.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; + +/** + * An immutable client-side representation of RuleSet. + */ +public interface RuleSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the profileName property: The name of the profile which holds the rule set. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner object. + * + * @return the inner object. + */ + RuleSetInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetListResult.java new file mode 100644 index 000000000000..4bf4706f57cb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of AzureFrontDoor rule sets within a profile. + */ + private List value; + + /* + * URL to get the next set of rule set objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of RuleSetListResult class. + */ + public RuleSetListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor rule sets within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of rule set objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of rule set objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the RuleSetListResult object itself. + */ + public RuleSetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleSetListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleSetListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleSetListResult. + */ + public static RuleSetListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleSetListResult deserializedRuleSetListResult = new RuleSetListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RuleSetInner.fromJson(reader1)); + deserializedRuleSetListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRuleSetListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleSetListResult; + }); + } +} 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 000000000000..75ed1e482d2e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSets.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RuleSets. + */ +public interface RuleSets { + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String ruleSetName, + Context context); + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + */ + RuleSet get(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information along with + * {@link Response}. + */ + Response createWithResponse(String resourceGroupName, String profileName, String ruleSetName, + Context context); + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information. + */ + RuleSet create(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String ruleSetName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName, + Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdateParameters.java new file mode 100644 index 000000000000..b7e6800bddd8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdateParameters.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleUpdatePropertiesParameters; +import java.io.IOException; +import java.util.List; + +/** + * The domain JSON object required for domain creation or update. + */ +@Fluent +public final class RuleUpdateParameters implements JsonSerializable { + /* + * The JSON object that contains the properties of the rule to update. + */ + private RuleUpdatePropertiesParameters innerProperties; + + /** + * Creates an instance of RuleUpdateParameters class. + */ + public RuleUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the rule to update. + * + * @return the innerProperties value. + */ + private RuleUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the ruleSetName property: The name of the rule set containing the rule. + * + * @return the ruleSetName value. + */ + public String ruleSetName() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSetName(); + } + + /** + * Get the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value. + */ + public Integer order() { + return this.innerProperties() == null ? null : this.innerProperties().order(); + } + + /** + * Set the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @param order the order value to set. + * @return the RuleUpdateParameters object itself. + */ + public RuleUpdateParameters withOrder(Integer order) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleUpdatePropertiesParameters(); + } + this.innerProperties().withOrder(order); + return this; + } + + /** + * Get the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value. + */ + public List conditions() { + return this.innerProperties() == null ? null : this.innerProperties().conditions(); + } + + /** + * Set the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @param conditions the conditions value to set. + * @return the RuleUpdateParameters object itself. + */ + public RuleUpdateParameters withConditions(List conditions) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleUpdatePropertiesParameters(); + } + this.innerProperties().withConditions(conditions); + return this; + } + + /** + * Get the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @param actions the actions value to set. + * @return the RuleUpdateParameters object itself. + */ + public RuleUpdateParameters withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleUpdatePropertiesParameters(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Get the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @return the matchProcessingBehavior value. + */ + public MatchProcessingBehavior matchProcessingBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().matchProcessingBehavior(); + } + + /** + * Set the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @param matchProcessingBehavior the matchProcessingBehavior value to set. + * @return the RuleUpdateParameters object itself. + */ + public RuleUpdateParameters withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleUpdatePropertiesParameters(); + } + this.innerProperties().withMatchProcessingBehavior(matchProcessingBehavior); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleUpdateParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleUpdateParameters. + */ + public static RuleUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleUpdateParameters deserializedRuleUpdateParameters = new RuleUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedRuleUpdateParameters.innerProperties = RuleUpdatePropertiesParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleUpdateParameters; + }); + } +} 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 000000000000..074ba12022e8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rules.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Rules. + */ +public interface Rules { + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName, + Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String ruleSetName, String ruleName, + Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set. + */ + Rule get(String resourceGroupName, String profileName, String ruleSetName, String ruleName); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String ruleSetName, String ruleName); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String ruleSetName, String ruleName, Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response}. + */ + Rule getById(String id); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Rule resource. + * + * @param name resource name. + * @return the first stage of the new Rule definition. + */ + Rule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryMatchOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryMatchOperator.java new file mode 100644 index 000000000000..3e2dfea07881 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryMatchOperator.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * When matchVariable is a collection, operate on the selector to specify which elements in the collection this rule + * applies to. + */ +public final class ScrubbingRuleEntryMatchOperator extends ExpandableStringEnum { + /** + * Static value EqualsAny for ScrubbingRuleEntryMatchOperator. + */ + public static final ScrubbingRuleEntryMatchOperator EQUALS_ANY = fromString("EqualsAny"); + + /** + * Creates a new instance of ScrubbingRuleEntryMatchOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScrubbingRuleEntryMatchOperator() { + } + + /** + * Creates or finds a ScrubbingRuleEntryMatchOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScrubbingRuleEntryMatchOperator. + */ + public static ScrubbingRuleEntryMatchOperator fromString(String name) { + return fromString(name, ScrubbingRuleEntryMatchOperator.class); + } + + /** + * Gets known ScrubbingRuleEntryMatchOperator values. + * + * @return known ScrubbingRuleEntryMatchOperator values. + */ + public static Collection values() { + return values(ScrubbingRuleEntryMatchOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryMatchVariable.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryMatchVariable.java new file mode 100644 index 000000000000..82d6bffe7654 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryMatchVariable.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The variable to be scrubbed from the logs. + */ +public final class ScrubbingRuleEntryMatchVariable extends ExpandableStringEnum { + /** + * Static value RequestIPAddress for ScrubbingRuleEntryMatchVariable. + */ + public static final ScrubbingRuleEntryMatchVariable REQUEST_IPADDRESS = fromString("RequestIPAddress"); + + /** + * Static value RequestUri for ScrubbingRuleEntryMatchVariable. + */ + public static final ScrubbingRuleEntryMatchVariable REQUEST_URI = fromString("RequestUri"); + + /** + * Static value QueryStringArgNames for ScrubbingRuleEntryMatchVariable. + */ + public static final ScrubbingRuleEntryMatchVariable QUERY_STRING_ARG_NAMES = fromString("QueryStringArgNames"); + + /** + * Creates a new instance of ScrubbingRuleEntryMatchVariable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScrubbingRuleEntryMatchVariable() { + } + + /** + * Creates or finds a ScrubbingRuleEntryMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScrubbingRuleEntryMatchVariable. + */ + public static ScrubbingRuleEntryMatchVariable fromString(String name) { + return fromString(name, ScrubbingRuleEntryMatchVariable.class); + } + + /** + * Gets known ScrubbingRuleEntryMatchVariable values. + * + * @return known ScrubbingRuleEntryMatchVariable values. + */ + public static Collection values() { + return values(ScrubbingRuleEntryMatchVariable.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryState.java new file mode 100644 index 000000000000..a7d3e5adcd82 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ScrubbingRuleEntryState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the state of a log scrubbing rule. Default value is enabled. + */ +public final class ScrubbingRuleEntryState extends ExpandableStringEnum { + /** + * Static value Enabled for ScrubbingRuleEntryState. + */ + public static final ScrubbingRuleEntryState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for ScrubbingRuleEntryState. + */ + public static final ScrubbingRuleEntryState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ScrubbingRuleEntryState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScrubbingRuleEntryState() { + } + + /** + * Creates or finds a ScrubbingRuleEntryState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScrubbingRuleEntryState. + */ + public static ScrubbingRuleEntryState fromString(String name) { + return fromString(name, ScrubbingRuleEntryState.class); + } + + /** + * Gets known ScrubbingRuleEntryState values. + * + * @return known ScrubbingRuleEntryState values. + */ + public static Collection values() { + return values(ScrubbingRuleEntryState.class); + } +} 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 000000000000..d3c22e4eb935 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secret.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; + +/** + * An immutable client-side representation of Secret. + */ +public interface Secret { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the profileName property: The name of the profile which holds the secret. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the parameters property: object which contains secret parameters. + * + * @return the parameters value. + */ + SecretParameters parameters(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner object. + * + * @return the inner object. + */ + SecretInner innerModel(); + + /** + * The entirety of the Secret definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Secret definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Secret definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Secret definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + + /** + * The stage of the Secret definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithParameters { + /** + * Executes the create request. + * + * @return the created resource. + */ + Secret create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Secret create(Context context); + } + + /** + * The stage of the Secret definition allowing to specify parameters. + */ + interface WithParameters { + /** + * Specifies the parameters property: object which contains secret parameters. + * + * @param parameters object which contains secret parameters. + * @return the next definition stage. + */ + WithCreate withParameters(SecretParameters parameters); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Secret refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Secret refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretListResult.java new file mode 100644 index 000000000000..fc6de1c81be7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of AzureFrontDoor secrets within a profile. + */ + private List value; + + /* + * URL to get the next set of Secret objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of SecretListResult class. + */ + public SecretListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor secrets within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of Secret objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of Secret objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the SecretListResult object itself. + */ + public SecretListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecretListResult. + */ + public static SecretListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretListResult deserializedSecretListResult = new SecretListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SecretInner.fromJson(reader1)); + deserializedSecretListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecretListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretListResult; + }); + } +} 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 000000000000..d2ce4e2e17b6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretParameters.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The json object containing secret parameters. + */ +@Immutable +public class SecretParameters implements JsonSerializable { + /* + * The type of the secret resource. + */ + private SecretType type = SecretType.fromString("SecretParameters"); + + /** + * Creates an instance of SecretParameters class. + */ + public SecretParameters() { + } + + /** + * Get the type property: The type of the secret resource. + * + * @return the type value. + */ + public SecretType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecretParameters. + */ + public static SecretParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("UrlSigningKey".equals(discriminatorValue)) { + return UrlSigningKeyParameters.fromJson(readerToUse.reset()); + } else if ("ManagedCertificate".equals(discriminatorValue)) { + return ManagedCertificateParameters.fromJson(readerToUse.reset()); + } else if ("CustomerCertificate".equals(discriminatorValue)) { + return CustomerCertificateParameters.fromJson(readerToUse.reset()); + } else if ("AzureFirstPartyManagedCertificate".equals(discriminatorValue)) { + return AzureFirstPartyManagedCertificateParameters.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SecretParameters fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretParameters deserializedSecretParameters = new SecretParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSecretParameters.type = SecretType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretParameters; + }); + } +} 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 000000000000..f0860cba06b5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the secret resource. + */ +public final class SecretType extends ExpandableStringEnum { + /** + * Static value UrlSigningKey for SecretType. + */ + public static final SecretType URL_SIGNING_KEY = fromString("UrlSigningKey"); + + /** + * Static value CustomerCertificate for SecretType. + */ + public static final SecretType CUSTOMER_CERTIFICATE = fromString("CustomerCertificate"); + + /** + * Static value ManagedCertificate for SecretType. + */ + public static final SecretType MANAGED_CERTIFICATE = fromString("ManagedCertificate"); + + /** + * Static value AzureFirstPartyManagedCertificate for SecretType. + */ + public static final SecretType AZURE_FIRST_PARTY_MANAGED_CERTIFICATE + = fromString("AzureFirstPartyManagedCertificate"); + + /** + * Creates a new instance of SecretType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecretType() { + } + + /** + * Creates or finds a SecretType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecretType. + */ + public static SecretType fromString(String name) { + return fromString(name, SecretType.class); + } + + /** + * Gets known SecretType values. + * + * @return known SecretType values. + */ + public static Collection values() { + return values(SecretType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secrets.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secrets.java new file mode 100644 index 000000000000..e7f213ab7246 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secrets.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 Secrets. + */ +public interface Secrets { + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String secretName, Context context); + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile. + */ + Secret get(String resourceGroupName, String profileName, String secretName); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String secretName); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String secretName, Context context); + + /** + * Gets an existing Secret within a profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response}. + */ + Secret getById(String id); + + /** + * Gets an existing Secret within a profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing Secret within profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing Secret within profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Secret resource. + * + * @param name resource name. + * @return the first stage of the new Secret definition. + */ + Secret.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicies.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicies.java new file mode 100644 index 000000000000..c72a6f1a5e8f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicies.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 SecurityPolicies. + */ +public interface SecurityPolicies { + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String securityPolicyName, + Context context); + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile. + */ + SecurityPolicy get(String resourceGroupName, String profileName, String securityPolicyName); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String securityPolicyName); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, String securityPolicyName, Context context); + + /** + * Gets an existing security policy within a profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response}. + */ + SecurityPolicy getById(String id); + + /** + * Gets an existing security policy within a profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing security policy within profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing security policy within profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SecurityPolicy resource. + * + * @param name resource name. + * @return the first stage of the new SecurityPolicy definition. + */ + SecurityPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicy.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicy.java new file mode 100644 index 000000000000..67c28d4e9347 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicy.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; + +/** + * An immutable client-side representation of SecurityPolicy. + */ +public interface SecurityPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the profileName property: The name of the profile which holds the security policy. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + SecurityPolicyPropertiesParameters parameters(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner object. + * + * @return the inner object. + */ + SecurityPolicyInner innerModel(); + + /** + * The entirety of the SecurityPolicy definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SecurityPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SecurityPolicy definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SecurityPolicy definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + + /** + * The stage of the SecurityPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithParameters { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityPolicy create(Context context); + } + + /** + * The stage of the SecurityPolicy definition allowing to specify parameters. + */ + interface WithParameters { + /** + * Specifies the parameters property: object which contains security policy parameters. + * + * @param parameters object which contains security policy parameters. + * @return the next definition stage. + */ + WithCreate withParameters(SecurityPolicyPropertiesParameters parameters); + } + } + + /** + * Begins update for the SecurityPolicy resource. + * + * @return the stage of resource update. + */ + SecurityPolicy.Update update(); + + /** + * The template for SecurityPolicy update. + */ + interface Update extends UpdateStages.WithParameters { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityPolicy apply(Context context); + } + + /** + * The SecurityPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the SecurityPolicy update allowing to specify parameters. + */ + interface WithParameters { + /** + * Specifies the parameters property: object which contains security policy parameters. + * + * @param parameters object which contains security policy parameters. + * @return the next definition stage. + */ + Update withParameters(SecurityPolicyPropertiesParameters parameters); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityPolicy refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyListResult.java new file mode 100644 index 000000000000..280e2f2eb012 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyListResult.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of Security policies within a profile + */ + private List value; + + /* + * URL to get the next set of security policy objects if there is any. + */ + private String nextLink; + + /** + * Creates an instance of SecurityPolicyListResult class. + */ + public SecurityPolicyListResult() { + } + + /** + * Get the value property: List of Security policies within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of security policy objects if there is any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of security policy objects if there is any. + * + * @param nextLink the nextLink value to set. + * @return the SecurityPolicyListResult object itself. + */ + public SecurityPolicyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPolicyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPolicyListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityPolicyListResult. + */ + public static SecurityPolicyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPolicyListResult deserializedSecurityPolicyListResult = new SecurityPolicyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SecurityPolicyInner.fromJson(reader1)); + deserializedSecurityPolicyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecurityPolicyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPolicyListResult; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyPropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyPropertiesParameters.java new file mode 100644 index 000000000000..3123787bcb4c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyPropertiesParameters.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The json object containing security policy parameters. + */ +@Immutable +public class SecurityPolicyPropertiesParameters implements JsonSerializable { + /* + * The type of the Security policy to create. + */ + private SecurityPolicyType type = SecurityPolicyType.fromString("SecurityPolicyPropertiesParameters"); + + /** + * Creates an instance of SecurityPolicyPropertiesParameters class. + */ + public SecurityPolicyPropertiesParameters() { + } + + /** + * Get the type property: The type of the Security policy to create. + * + * @return the type value. + */ + public SecurityPolicyType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPolicyPropertiesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPolicyPropertiesParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityPolicyPropertiesParameters. + */ + public static SecurityPolicyPropertiesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("WebApplicationFirewall".equals(discriminatorValue)) { + return SecurityPolicyWebApplicationFirewallParameters.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SecurityPolicyPropertiesParameters fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPolicyPropertiesParameters deserializedSecurityPolicyPropertiesParameters + = new SecurityPolicyPropertiesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSecurityPolicyPropertiesParameters.type + = SecurityPolicyType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPolicyPropertiesParameters; + }); + } +} 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 000000000000..5b96d5ecfbc6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyType.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 java.util.Collection; + +/** + * The type of the Security policy to create. + */ +public final class SecurityPolicyType extends ExpandableStringEnum { + /** + * Static value WebApplicationFirewall for SecurityPolicyType. + */ + public static final SecurityPolicyType WEB_APPLICATION_FIREWALL = fromString("WebApplicationFirewall"); + + /** + * Creates a new instance of SecurityPolicyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityPolicyType() { + } + + /** + * Creates or finds a SecurityPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityPolicyType. + */ + public static SecurityPolicyType fromString(String name) { + return fromString(name, SecurityPolicyType.class); + } + + /** + * Gets known SecurityPolicyType values. + * + * @return known SecurityPolicyType values. + */ + public static Collection values() { + return values(SecurityPolicyType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyUpdateParameters.java new file mode 100644 index 000000000000..82e7768ddb70 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyUpdateParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyUpdateProperties; +import java.io.IOException; + +/** + * The JSON object containing security policy update parameters. + */ +@Fluent +public final class SecurityPolicyUpdateParameters implements JsonSerializable { + /* + * The json object that contains properties required to update a security policy + */ + private SecurityPolicyUpdateProperties innerProperties; + + /** + * Creates an instance of SecurityPolicyUpdateParameters class. + */ + public SecurityPolicyUpdateParameters() { + } + + /** + * Get the innerProperties property: The json object that contains properties required to update a security policy. + * + * @return the innerProperties value. + */ + private SecurityPolicyUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyPropertiesParameters parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: object which contains security policy parameters. + * + * @param parameters the parameters value to set. + * @return the SecurityPolicyUpdateParameters object itself. + */ + public SecurityPolicyUpdateParameters withParameters(SecurityPolicyPropertiesParameters parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityPolicyUpdateProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPolicyUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPolicyUpdateParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityPolicyUpdateParameters. + */ + public static SecurityPolicyUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPolicyUpdateParameters deserializedSecurityPolicyUpdateParameters + = new SecurityPolicyUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSecurityPolicyUpdateParameters.innerProperties + = SecurityPolicyUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPolicyUpdateParameters; + }); + } +} 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 000000000000..40c7c02ddd02 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallAssociation.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * settings for security policy patterns to match. + */ +@Fluent +public final class SecurityPolicyWebApplicationFirewallAssociation + implements JsonSerializable { + /* + * List of domains. + */ + private List domains; + + /* + * List of paths + */ + private List patternsToMatch; + + /** + * Creates an instance of SecurityPolicyWebApplicationFirewallAssociation class. + */ + public SecurityPolicyWebApplicationFirewallAssociation() { + } + + /** + * Get the domains property: List of domains. + * + * @return the domains value. + */ + public List domains() { + return this.domains; + } + + /** + * Set the domains property: List of domains. + * + * @param domains the domains value to set. + * @return the SecurityPolicyWebApplicationFirewallAssociation object itself. + */ + public SecurityPolicyWebApplicationFirewallAssociation withDomains(List domains) { + this.domains = domains; + return this; + } + + /** + * Get the patternsToMatch property: List of paths. + * + * @return the patternsToMatch value. + */ + public List patternsToMatch() { + return this.patternsToMatch; + } + + /** + * Set the patternsToMatch property: List of paths. + * + * @param patternsToMatch the patternsToMatch value to set. + * @return the SecurityPolicyWebApplicationFirewallAssociation object itself. + */ + public SecurityPolicyWebApplicationFirewallAssociation withPatternsToMatch(List patternsToMatch) { + this.patternsToMatch = patternsToMatch; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domains() != null) { + domains().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("domains", this.domains, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("patternsToMatch", this.patternsToMatch, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPolicyWebApplicationFirewallAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPolicyWebApplicationFirewallAssociation if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityPolicyWebApplicationFirewallAssociation. + */ + public static SecurityPolicyWebApplicationFirewallAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPolicyWebApplicationFirewallAssociation deserializedSecurityPolicyWebApplicationFirewallAssociation + = new SecurityPolicyWebApplicationFirewallAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domains".equals(fieldName)) { + List domains + = reader.readArray(reader1 -> ActivatedResourceReference.fromJson(reader1)); + deserializedSecurityPolicyWebApplicationFirewallAssociation.domains = domains; + } else if ("patternsToMatch".equals(fieldName)) { + List patternsToMatch = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityPolicyWebApplicationFirewallAssociation.patternsToMatch = patternsToMatch; + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPolicyWebApplicationFirewallAssociation; + }); + } +} 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 000000000000..24e9c4704bc6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallParameters.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The json object containing security policy waf parameters. + */ +@Fluent +public final class SecurityPolicyWebApplicationFirewallParameters extends SecurityPolicyPropertiesParameters { + /* + * The type of the Security policy to create. + */ + private SecurityPolicyType type = SecurityPolicyType.WEB_APPLICATION_FIREWALL; + + /* + * Resource ID. + */ + private ResourceReference wafPolicy; + + /* + * Waf associations + */ + private List associations; + + /** + * Creates an instance of SecurityPolicyWebApplicationFirewallParameters class. + */ + public SecurityPolicyWebApplicationFirewallParameters() { + } + + /** + * Get the type property: The type of the Security policy to create. + * + * @return the type value. + */ + @Override + public SecurityPolicyType type() { + return this.type; + } + + /** + * 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() { + if (wafPolicy() != null) { + wafPolicy().validate(); + } + if (associations() != null) { + associations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("wafPolicy", this.wafPolicy); + jsonWriter.writeArrayField("associations", this.associations, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPolicyWebApplicationFirewallParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPolicyWebApplicationFirewallParameters if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityPolicyWebApplicationFirewallParameters. + */ + public static SecurityPolicyWebApplicationFirewallParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPolicyWebApplicationFirewallParameters deserializedSecurityPolicyWebApplicationFirewallParameters + = new SecurityPolicyWebApplicationFirewallParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSecurityPolicyWebApplicationFirewallParameters.type + = SecurityPolicyType.fromString(reader.getString()); + } else if ("wafPolicy".equals(fieldName)) { + deserializedSecurityPolicyWebApplicationFirewallParameters.wafPolicy + = ResourceReference.fromJson(reader); + } else if ("associations".equals(fieldName)) { + List associations = reader + .readArray(reader1 -> SecurityPolicyWebApplicationFirewallAssociation.fromJson(reader1)); + deserializedSecurityPolicyWebApplicationFirewallParameters.associations = associations; + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPolicyWebApplicationFirewallParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortMatchConditionParameters.java new file mode 100644 index 000000000000..b007ba9b30e4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for ServerPort match conditions. + */ +@Fluent +public final class ServerPortMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_SERVER_PORT_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private ServerPortOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of ServerPortMatchConditionParameters class. + */ + public ServerPortMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public ServerPortOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the ServerPortMatchConditionParameters object itself. + */ + public ServerPortMatchConditionParameters withOperator(ServerPortOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the ServerPortMatchConditionParameters object itself. + */ + public ServerPortMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the ServerPortMatchConditionParameters object itself. + */ + public ServerPortMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the ServerPortMatchConditionParameters object itself. + */ + public ServerPortMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model ServerPortMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServerPortMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerPortMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerPortMatchConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServerPortMatchConditionParameters. + */ + public static ServerPortMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerPortMatchConditionParameters deserializedServerPortMatchConditionParameters + = new ServerPortMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedServerPortMatchConditionParameters.operator + = ServerPortOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedServerPortMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedServerPortMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedServerPortMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedServerPortMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedServerPortMatchConditionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortOperator.java new file mode 100644 index 000000000000..77d429b7b812 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class ServerPortOperator extends ExpandableStringEnum { + /** + * Static value Any for ServerPortOperator. + */ + public static final ServerPortOperator ANY = fromString("Any"); + + /** + * Static value Equal for ServerPortOperator. + */ + public static final ServerPortOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for ServerPortOperator. + */ + public static final ServerPortOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for ServerPortOperator. + */ + public static final ServerPortOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for ServerPortOperator. + */ + public static final ServerPortOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for ServerPortOperator. + */ + public static final ServerPortOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for ServerPortOperator. + */ + public static final ServerPortOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for ServerPortOperator. + */ + public static final ServerPortOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for ServerPortOperator. + */ + public static final ServerPortOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for ServerPortOperator. + */ + public static final ServerPortOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of ServerPortOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerPortOperator() { + } + + /** + * Creates or finds a ServerPortOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerPortOperator. + */ + public static ServerPortOperator fromString(String name) { + return fromString(name, ServerPortOperator.class); + } + + /** + * Gets known ServerPortOperator values. + * + * @return known ServerPortOperator values. + */ + public static Collection values() { + return values(ServerPortOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServiceSpecification.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServiceSpecification.java new file mode 100644 index 000000000000..bb03006283a2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServiceSpecification.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * One property of operation, include log specifications. + */ +@Fluent +public final class ServiceSpecification implements JsonSerializable { + /* + * Log specifications of operation. + */ + private List logSpecifications; + + /* + * Metric specifications of operation. + */ + private List metricSpecifications; + + /** + * Creates an instance of ServiceSpecification class. + */ + public ServiceSpecification() { + } + + /** + * Get the logSpecifications property: Log specifications of operation. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Log specifications of operation. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get the metricSpecifications property: Metric specifications of operation. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("logSpecifications", this.logSpecifications, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("metricSpecifications", this.metricSpecifications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSpecification if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceSpecification. + */ + public static ServiceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSpecification deserializedServiceSpecification = new ServiceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logSpecifications".equals(fieldName)) { + List logSpecifications + = reader.readArray(reader1 -> LogSpecification.fromJson(reader1)); + deserializedServiceSpecification.logSpecifications = logSpecifications; + } else if ("metricSpecifications".equals(fieldName)) { + List metricSpecifications + = reader.readArray(reader1 -> MetricSpecification.fromJson(reader1)); + deserializedServiceSpecification.metricSpecifications = metricSpecifications; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSpecification; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceProperties.java new file mode 100644 index 000000000000..db4a0bb271a4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceProperties.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the properties of an existing Shared Private Link Resource to use when connecting to a private origin. + */ +@Fluent +public final class SharedPrivateLinkResourceProperties + implements JsonSerializable { + /* + * The resource id of the resource the shared private link resource is for. + */ + private ResourceReference privateLink; + + /* + * The location of the shared private link resource + */ + private String privateLinkLocation; + + /* + * The group id from the provider of resource the shared private link resource is for. + */ + private String groupId; + + /* + * The request message for requesting approval of the shared private link resource. + */ + private String requestMessage; + + /* + * Status of the shared private link resource. Can be Pending, Approved, Rejected, Disconnected, or Timeout. + */ + private SharedPrivateLinkResourceStatus status; + + /** + * Creates an instance of SharedPrivateLinkResourceProperties class. + */ + public SharedPrivateLinkResourceProperties() { + } + + /** + * Get the privateLink property: The resource id of the resource the shared private link resource is for. + * + * @return the privateLink value. + */ + public ResourceReference privateLink() { + return this.privateLink; + } + + /** + * Set the privateLink property: The resource id of the resource the shared private link resource is for. + * + * @param privateLink the privateLink value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withPrivateLink(ResourceReference privateLink) { + this.privateLink = privateLink; + return this; + } + + /** + * Get the privateLinkLocation property: The location of the shared private link resource. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.privateLinkLocation; + } + + /** + * Set the privateLinkLocation property: The location of the shared private link resource. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withPrivateLinkLocation(String privateLinkLocation) { + this.privateLinkLocation = privateLinkLocation; + return this; + } + + /** + * Get the groupId property: The group id from the provider of resource the shared private link resource is for. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The group id from the provider of resource the shared private link resource is for. + * + * @param groupId the groupId value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requestMessage property: The request message for requesting approval of the shared private link resource. + * + * @return the requestMessage value. + */ + public String requestMessage() { + return this.requestMessage; + } + + /** + * Set the requestMessage property: The request message for requesting approval of the shared private link resource. + * + * @param requestMessage the requestMessage value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withRequestMessage(String requestMessage) { + this.requestMessage = requestMessage; + return this; + } + + /** + * Get the status property: Status of the shared private link resource. Can be Pending, Approved, Rejected, + * Disconnected, or Timeout. + * + * @return the status value. + */ + public SharedPrivateLinkResourceStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the shared private link resource. Can be Pending, Approved, Rejected, + * Disconnected, or Timeout. + * + * @param status the status value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withStatus(SharedPrivateLinkResourceStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateLink() != null) { + privateLink().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLink", this.privateLink); + jsonWriter.writeStringField("privateLinkLocation", this.privateLinkLocation); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("requestMessage", this.requestMessage); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SharedPrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SharedPrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SharedPrivateLinkResourceProperties. + */ + public static SharedPrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SharedPrivateLinkResourceProperties deserializedSharedPrivateLinkResourceProperties + = new SharedPrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLink".equals(fieldName)) { + deserializedSharedPrivateLinkResourceProperties.privateLink = ResourceReference.fromJson(reader); + } else if ("privateLinkLocation".equals(fieldName)) { + deserializedSharedPrivateLinkResourceProperties.privateLinkLocation = reader.getString(); + } else if ("groupId".equals(fieldName)) { + deserializedSharedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requestMessage".equals(fieldName)) { + deserializedSharedPrivateLinkResourceProperties.requestMessage = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedSharedPrivateLinkResourceProperties.status + = SharedPrivateLinkResourceStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSharedPrivateLinkResourceProperties; + }); + } +} 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 000000000000..205bb9127af5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceStatus.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +/** + * Status of the shared private link resource. Can be Pending, Approved, Rejected, Disconnected, or Timeout. + */ +public enum SharedPrivateLinkResourceStatus { + /** + * Enum value Pending. + */ + PENDING("Pending"), + + /** + * Enum value Approved. + */ + APPROVED("Approved"), + + /** + * Enum value Rejected. + */ + REJECTED("Rejected"), + + /** + * Enum value Disconnected. + */ + DISCONNECTED("Disconnected"), + + /** + * Enum value Timeout. + */ + TIMEOUT("Timeout"); + + /** + * The actual serialized value for a SharedPrivateLinkResourceStatus instance. + */ + private final String value; + + SharedPrivateLinkResourceStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SharedPrivateLinkResourceStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed SharedPrivateLinkResourceStatus object, or null if unable to parse. + */ + public static SharedPrivateLinkResourceStatus fromString(String value) { + if (value == null) { + return null; + } + SharedPrivateLinkResourceStatus[] items = SharedPrivateLinkResourceStatus.values(); + for (SharedPrivateLinkResourceStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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 000000000000..21a7111a7088 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Sku.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Standard_Verizon = The SKU name for a Standard Verizon CDN profile. + * Premium_Verizon = The SKU name for a Premium Verizon CDN profile. + * Custom_Verizon = The SKU name for a Custom Verizon CDN profile. + * Standard_Akamai = The SKU name for an Akamai CDN profile. + * Standard_ChinaCdn = The SKU name for a China CDN profile for VOD, Web and download scenarios using GB based billing + * model. + * Standard_Microsoft = The SKU name for a Standard Microsoft CDN profile. + * Standard_AzureFrontDoor = The SKU name for an Azure Front Door Standard profile. + * Premium_AzureFrontDoor = The SKU name for an Azure Front Door Premium profile. + * Standard_955BandWidth_ChinaCdn = The SKU name for a China CDN profile for VOD, Web and download scenarios using 95-5 + * peak bandwidth billing model. + * Standard_AvgBandWidth_ChinaCdn = The SKU name for a China CDN profile for VOD, Web and download scenarios using + * monthly average peak bandwidth billing model. + * StandardPlus_ChinaCdn = The SKU name for a China CDN profile for live-streaming using GB based billing model. + * StandardPlus_955BandWidth_ChinaCdn = The SKU name for a China CDN live-streaming profile using 95-5 peak bandwidth + * billing model. + * StandardPlus_AvgBandWidth_ChinaCdn = The SKU name for a China CDN live-streaming profile using monthly average peak + * bandwidth billing model. + */ +@Fluent +public final class Sku implements JsonSerializable { + /* + * Name of the pricing tier. + */ + private SkuName name; + + /** + * Creates an instance of Sku class. + */ + public Sku() { + } + + /** + * Get the name property: Name of the pricing tier. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: Name of the pricing tier. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = SkuName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } +} 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 000000000000..1ddc0d9ed13d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SkuName.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Name of the pricing tier. + */ +public final class SkuName extends ExpandableStringEnum { + /** + * Static value Standard_Verizon for SkuName. + */ + public static final SkuName STANDARD_VERIZON = fromString("Standard_Verizon"); + + /** + * Static value Premium_Verizon for SkuName. + */ + public static final SkuName PREMIUM_VERIZON = fromString("Premium_Verizon"); + + /** + * Static value Custom_Verizon for SkuName. + */ + public static final SkuName CUSTOM_VERIZON = fromString("Custom_Verizon"); + + /** + * Static value Standard_Akamai for SkuName. + */ + public static final SkuName STANDARD_AKAMAI = fromString("Standard_Akamai"); + + /** + * Static value Standard_ChinaCdn for SkuName. + */ + public static final SkuName STANDARD_CHINA_CDN = fromString("Standard_ChinaCdn"); + + /** + * Static value Standard_Microsoft for SkuName. + */ + public static final SkuName STANDARD_MICROSOFT = fromString("Standard_Microsoft"); + + /** + * Static value Standard_AzureFrontDoor for SkuName. + */ + public static final SkuName STANDARD_AZURE_FRONT_DOOR = fromString("Standard_AzureFrontDoor"); + + /** + * Static value Premium_AzureFrontDoor for SkuName. + */ + public static final SkuName PREMIUM_AZURE_FRONT_DOOR = fromString("Premium_AzureFrontDoor"); + + /** + * Static value Standard_955BandWidth_ChinaCdn for SkuName. + */ + public static final SkuName STANDARD_955BAND_WIDTH_CHINA_CDN = fromString("Standard_955BandWidth_ChinaCdn"); + + /** + * Static value Standard_AvgBandWidth_ChinaCdn for SkuName. + */ + public static final SkuName STANDARD_AVG_BAND_WIDTH_CHINA_CDN = fromString("Standard_AvgBandWidth_ChinaCdn"); + + /** + * Static value StandardPlus_ChinaCdn for SkuName. + */ + public static final SkuName STANDARD_PLUS_CHINA_CDN = fromString("StandardPlus_ChinaCdn"); + + /** + * Static value StandardPlus_955BandWidth_ChinaCdn for SkuName. + */ + public static final SkuName STANDARD_PLUS_955BAND_WIDTH_CHINA_CDN + = fromString("StandardPlus_955BandWidth_ChinaCdn"); + + /** + * Static value StandardPlus_AvgBandWidth_ChinaCdn for SkuName. + */ + public static final SkuName STANDARD_PLUS_AVG_BAND_WIDTH_CHINA_CDN + = fromString("StandardPlus_AvgBandWidth_ChinaCdn"); + + /** + * Creates a new instance of SkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuName() { + } + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * Gets known SkuName values. + * + * @return known SkuName values. + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrMatchConditionParameters.java new file mode 100644 index 000000000000..6f07449099ed --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for SocketAddress match conditions. + */ +@Fluent +public final class SocketAddrMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_SOCKET_ADDR_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private SocketAddrOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of SocketAddrMatchConditionParameters class. + */ + public SocketAddrMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public SocketAddrOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the SocketAddrMatchConditionParameters object itself. + */ + public SocketAddrMatchConditionParameters withOperator(SocketAddrOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the SocketAddrMatchConditionParameters object itself. + */ + public SocketAddrMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the SocketAddrMatchConditionParameters object itself. + */ + public SocketAddrMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the SocketAddrMatchConditionParameters object itself. + */ + public SocketAddrMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model SocketAddrMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SocketAddrMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SocketAddrMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SocketAddrMatchConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SocketAddrMatchConditionParameters. + */ + public static SocketAddrMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SocketAddrMatchConditionParameters deserializedSocketAddrMatchConditionParameters + = new SocketAddrMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedSocketAddrMatchConditionParameters.operator + = SocketAddrOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedSocketAddrMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedSocketAddrMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedSocketAddrMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedSocketAddrMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedSocketAddrMatchConditionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrOperator.java new file mode 100644 index 000000000000..a2bf608e7b44 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class SocketAddrOperator extends ExpandableStringEnum { + /** + * Static value Any for SocketAddrOperator. + */ + public static final SocketAddrOperator ANY = fromString("Any"); + + /** + * Static value IPMatch for SocketAddrOperator. + */ + public static final SocketAddrOperator IPMATCH = fromString("IPMatch"); + + /** + * Creates a new instance of SocketAddrOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SocketAddrOperator() { + } + + /** + * Creates or finds a SocketAddrOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding SocketAddrOperator. + */ + public static SocketAddrOperator fromString(String name) { + return fromString(name, SocketAddrOperator.class); + } + + /** + * Gets known SocketAddrOperator values. + * + * @return known SocketAddrOperator values. + */ + public static Collection values() { + return values(SocketAddrOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocol.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocol.java new file mode 100644 index 000000000000..039b601c2be3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocol.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol of an established TLS connection. + */ +public final class SslProtocol extends ExpandableStringEnum { + /** + * Static value TLSv1 for SslProtocol. + */ + public static final SslProtocol TLSV1 = fromString("TLSv1"); + + /** + * Static value TLSv1.1 for SslProtocol. + */ + public static final SslProtocol TLSV1_1 = fromString("TLSv1.1"); + + /** + * Static value TLSv1.2 for SslProtocol. + */ + public static final SslProtocol TLSV1_2 = fromString("TLSv1.2"); + + /** + * Creates a new instance of SslProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SslProtocol() { + } + + /** + * Creates or finds a SslProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding SslProtocol. + */ + public static SslProtocol fromString(String name) { + return fromString(name, SslProtocol.class); + } + + /** + * Gets known SslProtocol values. + * + * @return known SslProtocol values. + */ + public static Collection values() { + return values(SslProtocol.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolMatchConditionParameters.java new file mode 100644 index 000000000000..ca7b4b1f6d86 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolMatchConditionParameters.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for SslProtocol match conditions. + */ +@Fluent +public final class SslProtocolMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_SSL_PROTOCOL_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private SslProtocolOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of SslProtocolMatchConditionParameters class. + */ + public SslProtocolMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public SslProtocolOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the SslProtocolMatchConditionParameters object itself. + */ + public SslProtocolMatchConditionParameters withOperator(SslProtocolOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the SslProtocolMatchConditionParameters object itself. + */ + public SslProtocolMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the SslProtocolMatchConditionParameters object itself. + */ + public SslProtocolMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the SslProtocolMatchConditionParameters object itself. + */ + public SslProtocolMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model SslProtocolMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SslProtocolMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SslProtocolMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SslProtocolMatchConditionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SslProtocolMatchConditionParameters. + */ + public static SslProtocolMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SslProtocolMatchConditionParameters deserializedSslProtocolMatchConditionParameters + = new SslProtocolMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedSslProtocolMatchConditionParameters.operator + = SslProtocolOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedSslProtocolMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedSslProtocolMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues + = reader.readArray(reader1 -> SslProtocol.fromString(reader1.getString())); + deserializedSslProtocolMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedSslProtocolMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedSslProtocolMatchConditionParameters; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolOperator.java new file mode 100644 index 000000000000..3a64bc5c1769 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolOperator.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 java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class SslProtocolOperator extends ExpandableStringEnum { + /** + * Static value Equal for SslProtocolOperator. + */ + public static final SslProtocolOperator EQUAL = fromString("Equal"); + + /** + * Creates a new instance of SslProtocolOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SslProtocolOperator() { + } + + /** + * Creates or finds a SslProtocolOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding SslProtocolOperator. + */ + public static SslProtocolOperator fromString(String name) { + return fromString(name, SslProtocolOperator.class); + } + + /** + * Gets known SslProtocolOperator values. + * + * @return known SslProtocolOperator values. + */ + public static Collection values() { + return values(SslProtocolOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SsoUri.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SsoUri.java new file mode 100644 index 000000000000..5b7a8374d888 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SsoUri.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.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 000000000000..a24fb49ddcc9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Status.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 java.util.Collection; + +/** + * The validation status. + */ +public final class Status extends ExpandableStringEnum { + /** + * Static value Valid for Status. + */ + public static final Status VALID = fromString("Valid"); + + /** + * Static value Invalid for Status. + */ + public static final Status INVALID = fromString("Invalid"); + + /** + * Static value AccessDenied for Status. + */ + public static final Status ACCESS_DENIED = fromString("AccessDenied"); + + /** + * Static value CertificateExpired for Status. + */ + public static final Status CERTIFICATE_EXPIRED = fromString("CertificateExpired"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SupportedOptimizationTypesListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SupportedOptimizationTypesListResult.java new file mode 100644 index 000000000000..cd8275f5e761 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SupportedOptimizationTypesListResult.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of SupportedOptimizationTypesListResult. + */ +public interface SupportedOptimizationTypesListResult { + /** + * Gets the supportedOptimizationTypes property: Supported optimization types for a profile. + * + * @return the supportedOptimizationTypes value. + */ + List supportedOptimizationTypes(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner + * object. + * + * @return the inner object. + */ + SupportedOptimizationTypesListResultInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Transform.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Transform.java new file mode 100644 index 000000000000..c0155288f5c7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Transform.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes what transforms are applied before matching. + */ +public final class Transform extends ExpandableStringEnum { + /** + * Static value Lowercase for Transform. + */ + public static final Transform LOWERCASE = fromString("Lowercase"); + + /** + * Static value Uppercase for Transform. + */ + public static final Transform UPPERCASE = fromString("Uppercase"); + + /** + * Static value Trim for Transform. + */ + public static final Transform TRIM = fromString("Trim"); + + /** + * Static value UrlDecode for Transform. + */ + public static final Transform URL_DECODE = fromString("UrlDecode"); + + /** + * Static value UrlEncode for Transform. + */ + public static final Transform URL_ENCODE = fromString("UrlEncode"); + + /** + * Static value RemoveNulls for Transform. + */ + public static final Transform REMOVE_NULLS = fromString("RemoveNulls"); + + /** + * Creates a new instance of Transform value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Transform() { + } + + /** + * Creates or finds a Transform from its string representation. + * + * @param name a name to look for. + * @return the corresponding Transform. + */ + public static Transform fromString(String name) { + return fromString(name, Transform.class); + } + + /** + * Gets known Transform values. + * + * @return known Transform values. + */ + public static Collection values() { + return values(Transform.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/TransformType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/TransformType.java new file mode 100644 index 000000000000..03230b6078d1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/TransformType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes what transforms were applied before matching. + */ +public final class TransformType extends ExpandableStringEnum { + /** + * Static value Lowercase for TransformType. + */ + public static final TransformType LOWERCASE = fromString("Lowercase"); + + /** + * Static value Uppercase for TransformType. + */ + public static final TransformType UPPERCASE = fromString("Uppercase"); + + /** + * Static value Trim for TransformType. + */ + public static final TransformType TRIM = fromString("Trim"); + + /** + * Static value UrlDecode for TransformType. + */ + public static final TransformType URL_DECODE = fromString("UrlDecode"); + + /** + * Static value UrlEncode for TransformType. + */ + public static final TransformType URL_ENCODE = fromString("UrlEncode"); + + /** + * Static value RemoveNulls for TransformType. + */ + public static final TransformType REMOVE_NULLS = fromString("RemoveNulls"); + + /** + * Creates a new instance of TransformType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TransformType() { + } + + /** + * Creates or finds a TransformType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransformType. + */ + public static TransformType fromString(String name) { + return fromString(name, TransformType.class); + } + + /** + * Gets known TransformType values. + * + * @return known TransformType values. + */ + public static Collection values() { + return values(TransformType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UpdateRule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UpdateRule.java new file mode 100644 index 000000000000..8d5d6ec8528f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UpdateRule.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 java.util.Collection; + +/** + * Describes the action that shall be taken when the certificate is updated in Key Vault. + */ +public final class UpdateRule extends ExpandableStringEnum { + /** + * Static value NoAction for UpdateRule. + */ + public static final UpdateRule NO_ACTION = fromString("NoAction"); + + /** + * Creates a new instance of UpdateRule value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpdateRule() { + } + + /** + * Creates or finds a UpdateRule from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateRule. + */ + public static UpdateRule fromString(String name) { + return fromString(name, UpdateRule.class); + } + + /** + * Gets known UpdateRule values. + * + * @return known UpdateRule values. + */ + public static Collection values() { + return values(UpdateRule.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionMatchConditionParameters.java new file mode 100644 index 000000000000..5a64720b2644 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for UrlFileExtension match conditions. + */ +@Fluent +public final class UrlFileExtensionMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_URL_FILE_EXTENSION_MATCH_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private UrlFileExtensionOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of UrlFileExtensionMatchConditionParameters class. + */ + public UrlFileExtensionMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model UrlFileExtensionMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlFileExtensionMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlFileExtensionMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlFileExtensionMatchConditionParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlFileExtensionMatchConditionParameters. + */ + public static UrlFileExtensionMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlFileExtensionMatchConditionParameters deserializedUrlFileExtensionMatchConditionParameters + = new UrlFileExtensionMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedUrlFileExtensionMatchConditionParameters.operator + = UrlFileExtensionOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedUrlFileExtensionMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedUrlFileExtensionMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedUrlFileExtensionMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedUrlFileExtensionMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedUrlFileExtensionMatchConditionParameters; + }); + } +} 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 000000000000..91adfe571faf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class UrlFileExtensionOperator extends ExpandableStringEnum { + /** + * Static value Any for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator ANY = fromString("Any"); + + /** + * Static value Equal for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for UrlFileExtensionOperator. + */ + public static final UrlFileExtensionOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of UrlFileExtensionOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UrlFileExtensionOperator() { + } + + /** + * Creates or finds a UrlFileExtensionOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding UrlFileExtensionOperator. + */ + public static UrlFileExtensionOperator fromString(String name) { + return fromString(name, UrlFileExtensionOperator.class); + } + + /** + * Gets known UrlFileExtensionOperator values. + * + * @return known UrlFileExtensionOperator values. + */ + public static Collection values() { + return values(UrlFileExtensionOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameMatchConditionParameters.java new file mode 100644 index 000000000000..929e5ef4f59b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for UrlFilename match conditions. + */ +@Fluent +public final class UrlFileNameMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_URL_FILENAME_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private UrlFileNameOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of UrlFileNameMatchConditionParameters class. + */ + public UrlFileNameMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model UrlFileNameMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlFileNameMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlFileNameMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlFileNameMatchConditionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlFileNameMatchConditionParameters. + */ + public static UrlFileNameMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlFileNameMatchConditionParameters deserializedUrlFileNameMatchConditionParameters + = new UrlFileNameMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedUrlFileNameMatchConditionParameters.operator + = UrlFileNameOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedUrlFileNameMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedUrlFileNameMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedUrlFileNameMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedUrlFileNameMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedUrlFileNameMatchConditionParameters; + }); + } +} 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 000000000000..7d2f3b574770 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class UrlFileNameOperator extends ExpandableStringEnum { + /** + * Static value Any for UrlFileNameOperator. + */ + public static final UrlFileNameOperator ANY = fromString("Any"); + + /** + * Static value Equal for UrlFileNameOperator. + */ + public static final UrlFileNameOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for UrlFileNameOperator. + */ + public static final UrlFileNameOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for UrlFileNameOperator. + */ + public static final UrlFileNameOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for UrlFileNameOperator. + */ + public static final UrlFileNameOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for UrlFileNameOperator. + */ + public static final UrlFileNameOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for UrlFileNameOperator. + */ + public static final UrlFileNameOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for UrlFileNameOperator. + */ + public static final UrlFileNameOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for UrlFileNameOperator. + */ + public static final UrlFileNameOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value RegEx for UrlFileNameOperator. + */ + public static final UrlFileNameOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of UrlFileNameOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UrlFileNameOperator() { + } + + /** + * Creates or finds a UrlFileNameOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding UrlFileNameOperator. + */ + public static UrlFileNameOperator fromString(String name) { + return fromString(name, UrlFileNameOperator.class); + } + + /** + * Gets known UrlFileNameOperator values. + * + * @return known UrlFileNameOperator values. + */ + public static Collection values() { + return values(UrlFileNameOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathMatchConditionParameters.java new file mode 100644 index 000000000000..ab772292c5a2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathMatchConditionParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for UrlPath match conditions. + */ +@Fluent +public final class UrlPathMatchConditionParameters extends DeliveryRuleConditionParameters { + /* + * The typeName property. + */ + private DeliveryRuleConditionParametersType typeName + = DeliveryRuleConditionParametersType.DELIVERY_RULE_URL_PATH_MATCH_CONDITION_PARAMETERS; + + /* + * Describes operator to be matched + */ + private UrlPathOperator operator; + + /* + * Describes if this is negate condition or not + */ + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + private List matchValues; + + /* + * List of transforms + */ + private List transforms; + + /** + * Creates an instance of UrlPathMatchConditionParameters class. + */ + public UrlPathMatchConditionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleConditionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model UrlPathMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlPathMatchConditionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("negateCondition", this.negateCondition); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlPathMatchConditionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlPathMatchConditionParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlPathMatchConditionParameters. + */ + public static UrlPathMatchConditionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlPathMatchConditionParameters deserializedUrlPathMatchConditionParameters + = new UrlPathMatchConditionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedUrlPathMatchConditionParameters.operator + = UrlPathOperator.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedUrlPathMatchConditionParameters.typeName + = DeliveryRuleConditionParametersType.fromString(reader.getString()); + } else if ("negateCondition".equals(fieldName)) { + deserializedUrlPathMatchConditionParameters.negateCondition + = reader.getNullable(JsonReader::getBoolean); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedUrlPathMatchConditionParameters.matchValues = matchValues; + } else if ("transforms".equals(fieldName)) { + List transforms = reader.readArray(reader1 -> Transform.fromString(reader1.getString())); + deserializedUrlPathMatchConditionParameters.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedUrlPathMatchConditionParameters; + }); + } +} 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 000000000000..cb14d6766ee0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathOperator.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 java.util.Collection; + +/** + * Describes operator to be matched. + */ +public final class UrlPathOperator extends ExpandableStringEnum { + /** + * Static value Any for UrlPathOperator. + */ + public static final UrlPathOperator ANY = fromString("Any"); + + /** + * Static value Equal for UrlPathOperator. + */ + public static final UrlPathOperator EQUAL = fromString("Equal"); + + /** + * Static value Contains for UrlPathOperator. + */ + public static final UrlPathOperator CONTAINS = fromString("Contains"); + + /** + * Static value BeginsWith for UrlPathOperator. + */ + public static final UrlPathOperator BEGINS_WITH = fromString("BeginsWith"); + + /** + * Static value EndsWith for UrlPathOperator. + */ + public static final UrlPathOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value LessThan for UrlPathOperator. + */ + public static final UrlPathOperator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanOrEqual for UrlPathOperator. + */ + public static final UrlPathOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** + * Static value GreaterThan for UrlPathOperator. + */ + public static final UrlPathOperator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanOrEqual for UrlPathOperator. + */ + public static final UrlPathOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** + * Static value Wildcard for UrlPathOperator. + */ + public static final UrlPathOperator WILDCARD = fromString("Wildcard"); + + /** + * Static value RegEx for UrlPathOperator. + */ + public static final UrlPathOperator REG_EX = fromString("RegEx"); + + /** + * Creates a new instance of UrlPathOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UrlPathOperator() { + } + + /** + * Creates or finds a UrlPathOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding UrlPathOperator. + */ + public static UrlPathOperator fromString(String name) { + return fromString(name, UrlPathOperator.class); + } + + /** + * Gets known UrlPathOperator values. + * + * @return known UrlPathOperator values. + */ + public static Collection values() { + return values(UrlPathOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectAction.java new file mode 100644 index 000000000000..1554fc7870f9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectAction.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the url redirect action for the delivery rule. + */ +@Fluent +public final class UrlRedirectAction extends DeliveryRuleAction { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.URL_REDIRECT; + + /* + * Defines the parameters for the action. + */ + private UrlRedirectActionParameters parameters; + + /** + * Creates an instance of UrlRedirectAction class. + */ + public UrlRedirectAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + @Override + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property parameters in model UrlRedirectAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlRedirectAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlRedirectAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlRedirectAction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlRedirectAction. + */ + public static UrlRedirectAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlRedirectAction deserializedUrlRedirectAction = new UrlRedirectAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedUrlRedirectAction.parameters = UrlRedirectActionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedUrlRedirectAction.name = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUrlRedirectAction; + }); + } +} 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 000000000000..74e1fffd4efd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectActionParameters.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for the url redirect action. + */ +@Fluent +public final class UrlRedirectActionParameters extends DeliveryRuleActionParameters { + /* + * The typeName property. + */ + private DeliveryRuleActionParametersType typeName + = DeliveryRuleActionParametersType.DELIVERY_RULE_URL_REDIRECT_ACTION_PARAMETERS; + + /* + * The redirect type the rule will use when redirecting traffic. + */ + private RedirectType redirectType; + + /* + * Protocol to use for the redirect. The default value is MatchRequest + */ + 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. + */ + private String customPath; + + /* + * Host to redirect. Leave empty to use the incoming host as the destination host. + */ + 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. + */ + private String customQueryString; + + /* + * Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. + */ + private String customFragment; + + /** + * Creates an instance of UrlRedirectActionParameters class. + */ + public UrlRedirectActionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleActionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (redirectType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property redirectType in model UrlRedirectActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlRedirectActionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("redirectType", this.redirectType == null ? null : this.redirectType.toString()); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("destinationProtocol", + this.destinationProtocol == null ? null : this.destinationProtocol.toString()); + jsonWriter.writeStringField("customPath", this.customPath); + jsonWriter.writeStringField("customHostname", this.customHostname); + jsonWriter.writeStringField("customQueryString", this.customQueryString); + jsonWriter.writeStringField("customFragment", this.customFragment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlRedirectActionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlRedirectActionParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlRedirectActionParameters. + */ + public static UrlRedirectActionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlRedirectActionParameters deserializedUrlRedirectActionParameters = new UrlRedirectActionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("redirectType".equals(fieldName)) { + deserializedUrlRedirectActionParameters.redirectType = RedirectType.fromString(reader.getString()); + } else if ("typeName".equals(fieldName)) { + deserializedUrlRedirectActionParameters.typeName + = DeliveryRuleActionParametersType.fromString(reader.getString()); + } else if ("destinationProtocol".equals(fieldName)) { + deserializedUrlRedirectActionParameters.destinationProtocol + = DestinationProtocol.fromString(reader.getString()); + } else if ("customPath".equals(fieldName)) { + deserializedUrlRedirectActionParameters.customPath = reader.getString(); + } else if ("customHostname".equals(fieldName)) { + deserializedUrlRedirectActionParameters.customHostname = reader.getString(); + } else if ("customQueryString".equals(fieldName)) { + deserializedUrlRedirectActionParameters.customQueryString = reader.getString(); + } else if ("customFragment".equals(fieldName)) { + deserializedUrlRedirectActionParameters.customFragment = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUrlRedirectActionParameters; + }); + } +} 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 000000000000..d5b250ba530a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteAction.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the url rewrite action for the delivery rule. + */ +@Fluent +public final class UrlRewriteAction extends DeliveryRuleAction { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.URL_REWRITE; + + /* + * Defines the parameters for the action. + */ + private UrlRewriteActionParameters parameters; + + /** + * Creates an instance of UrlRewriteAction class. + */ + public UrlRewriteAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + @Override + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property parameters in model UrlRewriteAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlRewriteAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlRewriteAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlRewriteAction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlRewriteAction. + */ + public static UrlRewriteAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlRewriteAction deserializedUrlRewriteAction = new UrlRewriteAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedUrlRewriteAction.parameters = UrlRewriteActionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedUrlRewriteAction.name = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUrlRewriteAction; + }); + } +} 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 000000000000..6af6c2dc1e10 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteActionParameters.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the parameters for the url rewrite action. + */ +@Fluent +public final class UrlRewriteActionParameters extends DeliveryRuleActionParameters { + /* + * The typeName property. + */ + private DeliveryRuleActionParametersType typeName + = DeliveryRuleActionParametersType.DELIVERY_RULE_URL_REWRITE_ACTION_PARAMETERS; + + /* + * define a request URI pattern that identifies the type of requests that may be rewritten. If value is blank, all + * strings are matched. + */ + private String sourcePattern; + + /* + * Define the relative URL to which the above requests will be rewritten by. + */ + private String destination; + + /* + * Whether to preserve unmatched path. Default value is true. + */ + private Boolean preserveUnmatchedPath; + + /** + * Creates an instance of UrlRewriteActionParameters class. + */ + public UrlRewriteActionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleActionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (sourcePattern() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourcePattern in model UrlRewriteActionParameters")); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model UrlRewriteActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlRewriteActionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourcePattern", this.sourcePattern); + jsonWriter.writeStringField("destination", this.destination); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeBooleanField("preserveUnmatchedPath", this.preserveUnmatchedPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlRewriteActionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlRewriteActionParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlRewriteActionParameters. + */ + public static UrlRewriteActionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlRewriteActionParameters deserializedUrlRewriteActionParameters = new UrlRewriteActionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourcePattern".equals(fieldName)) { + deserializedUrlRewriteActionParameters.sourcePattern = reader.getString(); + } else if ("destination".equals(fieldName)) { + deserializedUrlRewriteActionParameters.destination = reader.getString(); + } else if ("typeName".equals(fieldName)) { + deserializedUrlRewriteActionParameters.typeName + = DeliveryRuleActionParametersType.fromString(reader.getString()); + } else if ("preserveUnmatchedPath".equals(fieldName)) { + deserializedUrlRewriteActionParameters.preserveUnmatchedPath + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedUrlRewriteActionParameters; + }); + } +} 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 000000000000..d269e9902355 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningAction.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the url signing action for the delivery rule. + */ +@Fluent +public final class UrlSigningAction extends DeliveryRuleAction { + /* + * The name of the action for the delivery rule. + */ + private DeliveryRuleActionValue name = DeliveryRuleActionValue.URL_SIGNING; + + /* + * Defines the parameters for the action. + */ + private UrlSigningActionParameters parameters; + + /** + * Creates an instance of UrlSigningAction class. + */ + public UrlSigningAction() { + } + + /** + * Get the name property: The name of the action for the delivery rule. + * + * @return the name value. + */ + @Override + public DeliveryRuleActionValue name() { + return this.name; + } + + /** + * 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() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property parameters in model UrlSigningAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlSigningAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlSigningAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlSigningAction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlSigningAction. + */ + public static UrlSigningAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlSigningAction deserializedUrlSigningAction = new UrlSigningAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedUrlSigningAction.parameters = UrlSigningActionParameters.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedUrlSigningAction.name = DeliveryRuleActionValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUrlSigningAction; + }); + } +} 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 000000000000..1ca05e8aa228 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningActionParameters.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines the parameters for the Url Signing action. + */ +@Fluent +public final class UrlSigningActionParameters extends DeliveryRuleActionParameters { + /* + * The typeName property. + */ + private DeliveryRuleActionParametersType typeName + = DeliveryRuleActionParametersType.DELIVERY_RULE_URL_SIGNING_ACTION_PARAMETERS; + + /* + * Algorithm to use for URL signing + */ + private Algorithm algorithm; + + /* + * Defines which query string parameters in the url to be considered for expires, key id etc. + */ + private List parameterNameOverride; + + /** + * Creates an instance of UrlSigningActionParameters class. + */ + public UrlSigningActionParameters() { + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + @Override + public DeliveryRuleActionParametersType typeName() { + return this.typeName; + } + + /** + * 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. + */ + @Override + public void validate() { + if (parameterNameOverride() != null) { + parameterNameOverride().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("typeName", this.typeName == null ? null : this.typeName.toString()); + jsonWriter.writeStringField("algorithm", this.algorithm == null ? null : this.algorithm.toString()); + jsonWriter.writeArrayField("parameterNameOverride", this.parameterNameOverride, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlSigningActionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlSigningActionParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UrlSigningActionParameters. + */ + public static UrlSigningActionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlSigningActionParameters deserializedUrlSigningActionParameters = new UrlSigningActionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("typeName".equals(fieldName)) { + deserializedUrlSigningActionParameters.typeName + = DeliveryRuleActionParametersType.fromString(reader.getString()); + } else if ("algorithm".equals(fieldName)) { + deserializedUrlSigningActionParameters.algorithm = Algorithm.fromString(reader.getString()); + } else if ("parameterNameOverride".equals(fieldName)) { + List parameterNameOverride + = reader.readArray(reader1 -> UrlSigningParamIdentifier.fromJson(reader1)); + deserializedUrlSigningActionParameters.parameterNameOverride = parameterNameOverride; + } else { + reader.skipChildren(); + } + } + + return deserializedUrlSigningActionParameters; + }); + } +} 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 000000000000..1cfcf07dfb08 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKey.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Url signing key. + */ +@Fluent +public final class UrlSigningKey implements JsonSerializable { + /* + * Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form + * the hash. + */ + private String keyId; + + /* + * Defines the parameters for using customer key vault for Url Signing Key. + */ + private KeyVaultSigningKeyParameters keySourceParameters; + + /** + * Creates an instance of UrlSigningKey class. + */ + public UrlSigningKey() { + } + + /** + * Get the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to + * indicate the key used to form the hash. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to + * indicate the key used to form the hash. + * + * @param keyId the keyId value to set. + * @return the UrlSigningKey object itself. + */ + public UrlSigningKey withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the keySourceParameters property: Defines the parameters for using customer key vault for Url Signing Key. + * + * @return the keySourceParameters value. + */ + public KeyVaultSigningKeyParameters keySourceParameters() { + return this.keySourceParameters; + } + + /** + * Set the keySourceParameters property: Defines the parameters for using customer key vault for Url Signing Key. + * + * @param keySourceParameters the keySourceParameters value to set. + * @return the UrlSigningKey object itself. + */ + public UrlSigningKey withKeySourceParameters(KeyVaultSigningKeyParameters keySourceParameters) { + this.keySourceParameters = keySourceParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyId in model UrlSigningKey")); + } + if (keySourceParameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keySourceParameters in model UrlSigningKey")); + } else { + keySourceParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlSigningKey.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyId", this.keyId); + jsonWriter.writeJsonField("keySourceParameters", this.keySourceParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlSigningKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlSigningKey if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlSigningKey. + */ + public static UrlSigningKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlSigningKey deserializedUrlSigningKey = new UrlSigningKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyId".equals(fieldName)) { + deserializedUrlSigningKey.keyId = reader.getString(); + } else if ("keySourceParameters".equals(fieldName)) { + deserializedUrlSigningKey.keySourceParameters = KeyVaultSigningKeyParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUrlSigningKey; + }); + } +} 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 000000000000..9a91d1015eb8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKeyParameters.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Url signing key parameters. + */ +@Fluent +public final class UrlSigningKeyParameters extends SecretParameters { + /* + * The type of the secret resource. + */ + private SecretType type = SecretType.URL_SIGNING_KEY; + + /* + * Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form + * the hash. + */ + private String keyId; + + /* + * Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + */ + private ResourceReference secretSource; + + /* + * Version of the secret to be used + */ + private String secretVersion; + + /** + * Creates an instance of UrlSigningKeyParameters class. + */ + public UrlSigningKeyParameters() { + } + + /** + * Get the type property: The type of the secret resource. + * + * @return the type value. + */ + @Override + public SecretType type() { + return this.type; + } + + /** + * Get the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to + * indicate the key used to form the hash. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to + * indicate the key used to form the hash. + * + * @param keyId the keyId value to set. + * @return the UrlSigningKeyParameters object itself. + */ + public UrlSigningKeyParameters withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @param secretSource the secretSource value to set. + * @return the UrlSigningKeyParameters object itself. + */ + public UrlSigningKeyParameters withSecretSource(ResourceReference secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Get the secretVersion property: Version of the secret to be used. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: Version of the secret to be used. + * + * @param secretVersion the secretVersion value to set. + * @return the UrlSigningKeyParameters object itself. + */ + public UrlSigningKeyParameters withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (keyId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyId in model UrlSigningKeyParameters")); + } + if (secretSource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secretSource in model UrlSigningKeyParameters")); + } else { + secretSource().validate(); + } + if (secretVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secretVersion in model UrlSigningKeyParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlSigningKeyParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyId", this.keyId); + jsonWriter.writeJsonField("secretSource", this.secretSource); + jsonWriter.writeStringField("secretVersion", this.secretVersion); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlSigningKeyParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlSigningKeyParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlSigningKeyParameters. + */ + public static UrlSigningKeyParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlSigningKeyParameters deserializedUrlSigningKeyParameters = new UrlSigningKeyParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyId".equals(fieldName)) { + deserializedUrlSigningKeyParameters.keyId = reader.getString(); + } else if ("secretSource".equals(fieldName)) { + deserializedUrlSigningKeyParameters.secretSource = ResourceReference.fromJson(reader); + } else if ("secretVersion".equals(fieldName)) { + deserializedUrlSigningKeyParameters.secretVersion = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUrlSigningKeyParameters.type = SecretType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUrlSigningKeyParameters; + }); + } +} 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 000000000000..5539c122ebee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningParamIdentifier.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines how to identify a parameter for a specific purpose e.g. expires. + */ +@Fluent +public final class UrlSigningParamIdentifier implements JsonSerializable { + /* + * Indicates the purpose of the parameter + */ + private ParamIndicator paramIndicator; + + /* + * Parameter name + */ + private String paramName; + + /** + * Creates an instance of UrlSigningParamIdentifier class. + */ + public UrlSigningParamIdentifier() { + } + + /** + * Get the paramIndicator property: Indicates the purpose of the parameter. + * + * @return the paramIndicator value. + */ + public ParamIndicator paramIndicator() { + return this.paramIndicator; + } + + /** + * Set the paramIndicator property: Indicates the purpose of the parameter. + * + * @param paramIndicator the paramIndicator value to set. + * @return the UrlSigningParamIdentifier object itself. + */ + public UrlSigningParamIdentifier withParamIndicator(ParamIndicator paramIndicator) { + this.paramIndicator = paramIndicator; + return this; + } + + /** + * Get the paramName property: Parameter name. + * + * @return the paramName value. + */ + public String paramName() { + return this.paramName; + } + + /** + * Set the paramName property: Parameter name. + * + * @param paramName the paramName value to set. + * @return the UrlSigningParamIdentifier object itself. + */ + public UrlSigningParamIdentifier withParamName(String paramName) { + this.paramName = paramName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (paramIndicator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property paramIndicator in model UrlSigningParamIdentifier")); + } + if (paramName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property paramName in model UrlSigningParamIdentifier")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlSigningParamIdentifier.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("paramIndicator", + this.paramIndicator == null ? null : this.paramIndicator.toString()); + jsonWriter.writeStringField("paramName", this.paramName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UrlSigningParamIdentifier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UrlSigningParamIdentifier if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UrlSigningParamIdentifier. + */ + public static UrlSigningParamIdentifier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UrlSigningParamIdentifier deserializedUrlSigningParamIdentifier = new UrlSigningParamIdentifier(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("paramIndicator".equals(fieldName)) { + deserializedUrlSigningParamIdentifier.paramIndicator + = ParamIndicator.fromString(reader.getString()); + } else if ("paramName".equals(fieldName)) { + deserializedUrlSigningParamIdentifier.paramName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUrlSigningParamIdentifier; + }); + } +} 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 000000000000..c0001a74f463 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Usage.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.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 000000000000..2e6db6d78af3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageName.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The usage names. + */ +@Fluent +public final class UsageName implements JsonSerializable { + /* + * A string describing the resource name. + */ + private String value; + + /* + * A localized string describing the resource name. + */ + private String localizedValue; + + /** + * Creates an instance of UsageName class. + */ + public UsageName() { + } + + /** + * Get the value property: A string describing the resource name. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: A string describing the resource name. + * + * @param value the value value to set. + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: A localized string describing the resource name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: A localized string describing the resource name. + * + * @param localizedValue the localizedValue value to set. + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("localizedValue", this.localizedValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageName if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the UsageName. + */ + public static UsageName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageName deserializedUsageName = new UsageName(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedUsageName.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedUsageName.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageName; + }); + } +} 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 000000000000..f1c4fe6f80ea --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageUnit.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 java.util.Collection; + +/** + * An enum describing the unit of measurement. + */ +public final class UsageUnit extends ExpandableStringEnum { + /** + * Static value Count for UsageUnit. + */ + public static final UsageUnit COUNT = fromString("Count"); + + /** + * Creates a new instance of UsageUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UsageUnit() { + } + + /** + * Creates or finds a UsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsageUnit. + */ + public static UsageUnit fromString(String name) { + return fromString(name, UsageUnit.class); + } + + /** + * Gets known UsageUnit values. + * + * @return known UsageUnit values. + */ + public static Collection values() { + return values(UsageUnit.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsagesListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsagesListResult.java new file mode 100644 index 000000000000..afd0d651c2b8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsagesListResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import java.io.IOException; +import java.util.List; + +/** + * The list usages operation response. + */ +@Fluent +public final class UsagesListResult implements JsonSerializable { + /* + * The list of resource usages. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of UsagesListResult class. + */ + public UsagesListResult() { + } + + /** + * Get the value property: The list of resource usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of resource usages. + * + * @param value the value value to set. + * @return the UsagesListResult object itself. + */ + public UsagesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the UsagesListResult object itself. + */ + public UsagesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsagesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsagesListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UsagesListResult. + */ + public static UsagesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsagesListResult deserializedUsagesListResult = new UsagesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); + deserializedUsagesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUsagesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsagesListResult; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserAssignedIdentity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..8ded812d7e03 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserAssignedIdentity.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} 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 000000000000..1bb00d09a071 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserManagedHttpsParameters.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the certificate source parameters using user's keyvault certificate for enabling SSL. + */ +@Fluent +public final class UserManagedHttpsParameters extends CustomDomainHttpsParameters { + /* + * Defines the source of the SSL certificate. + */ + private CertificateSource certificateSource = CertificateSource.AZURE_KEY_VAULT; + + /* + * Defines the certificate source parameters using user's keyvault certificate for enabling SSL. + */ + private KeyVaultCertificateSourceParameters certificateSourceParameters; + + /** + * Creates an instance of UserManagedHttpsParameters class. + */ + public UserManagedHttpsParameters() { + } + + /** + * Get the certificateSource property: Defines the source of the SSL certificate. + * + * @return the certificateSource value. + */ + @Override + public CertificateSource certificateSource() { + return this.certificateSource; + } + + /** + * 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() { + if (certificateSourceParameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property certificateSourceParameters in model UserManagedHttpsParameters")); + } else { + certificateSourceParameters().validate(); + } + if (protocolType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property protocolType in model UserManagedHttpsParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserManagedHttpsParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocolType", protocolType() == null ? null : protocolType().toString()); + jsonWriter.writeStringField("minimumTlsVersion", + minimumTlsVersion() == null ? null : minimumTlsVersion().toString()); + jsonWriter.writeJsonField("certificateSourceParameters", this.certificateSourceParameters); + jsonWriter.writeStringField("certificateSource", + this.certificateSource == null ? null : this.certificateSource.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserManagedHttpsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserManagedHttpsParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserManagedHttpsParameters. + */ + public static UserManagedHttpsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserManagedHttpsParameters deserializedUserManagedHttpsParameters = new UserManagedHttpsParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocolType".equals(fieldName)) { + deserializedUserManagedHttpsParameters + .withProtocolType(ProtocolType.fromString(reader.getString())); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedUserManagedHttpsParameters + .withMinimumTlsVersion(MinimumTlsVersion.fromString(reader.getString())); + } else if ("certificateSourceParameters".equals(fieldName)) { + deserializedUserManagedHttpsParameters.certificateSourceParameters + = KeyVaultCertificateSourceParameters.fromJson(reader); + } else if ("certificateSource".equals(fieldName)) { + deserializedUserManagedHttpsParameters.certificateSource + = CertificateSource.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUserManagedHttpsParameters; + }); + } +} 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 000000000000..3f3c21b14ffc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainInput.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input of the custom domain to be validated for DNS mapping. + */ +@Fluent +public final class ValidateCustomDomainInput implements JsonSerializable { + /* + * The host name of the custom domain. Must be a domain name. + */ + private String hostname; + + /** + * Creates an instance of ValidateCustomDomainInput class. + */ + public ValidateCustomDomainInput() { + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the ValidateCustomDomainInput object itself. + */ + public ValidateCustomDomainInput withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hostname in model ValidateCustomDomainInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateCustomDomainInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateCustomDomainInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateCustomDomainInput if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidateCustomDomainInput. + */ + public static ValidateCustomDomainInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateCustomDomainInput deserializedValidateCustomDomainInput = new ValidateCustomDomainInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedValidateCustomDomainInput.hostname = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateCustomDomainInput; + }); + } +} 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 000000000000..2b6c3bddbef0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainOutput.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.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 000000000000..167a164d77a9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeInput.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input of the validate probe API. + */ +@Fluent +public final class ValidateProbeInput implements JsonSerializable { + /* + * The probe URL to validate. + */ + private String probeUrl; + + /** + * Creates an instance of ValidateProbeInput class. + */ + public ValidateProbeInput() { + } + + /** + * Get the probeUrl property: The probe URL to validate. + * + * @return the probeUrl value. + */ + public String probeUrl() { + return this.probeUrl; + } + + /** + * Set the probeUrl property: The probe URL to validate. + * + * @param probeUrl the probeUrl value to set. + * @return the ValidateProbeInput object itself. + */ + public ValidateProbeInput withProbeUrl(String probeUrl) { + this.probeUrl = probeUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (probeUrl() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property probeUrl in model ValidateProbeInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateProbeInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("probeURL", this.probeUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateProbeInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateProbeInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidateProbeInput. + */ + public static ValidateProbeInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateProbeInput deserializedValidateProbeInput = new ValidateProbeInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("probeURL".equals(fieldName)) { + deserializedValidateProbeInput.probeUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateProbeInput; + }); + } +} 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 000000000000..f4a523a8957d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeOutput.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.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 000000000000..a9003bbfb2cc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretInput.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input of the secret to be validated. + */ +@Fluent +public final class ValidateSecretInput implements JsonSerializable { + /* + * The secret type. + */ + private SecretType secretType; + + /* + * Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName} + * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + */ + private ResourceReference secretSource; + + /* + * Secret version, if customer is using a specific version. + */ + private String secretVersion; + + /** + * Creates an instance of ValidateSecretInput class. + */ + public ValidateSecretInput() { + } + + /** + * Get the secretType property: The secret type. + * + * @return the secretType value. + */ + public SecretType secretType() { + return this.secretType; + } + + /** + * Set the secretType property: The secret type. + * + * @param secretType the secretType value to set. + * @return the ValidateSecretInput object itself. + */ + public ValidateSecretInput withSecretType(SecretType secretType) { + this.secretType = secretType; + return this; + } + + /** + * Get the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @param secretSource the secretSource value to set. + * @return the ValidateSecretInput object itself. + */ + public ValidateSecretInput withSecretSource(ResourceReference secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Get the secretVersion property: Secret version, if customer is using a specific version. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: Secret version, if customer is using a specific version. + * + * @param secretVersion the secretVersion value to set. + * @return the ValidateSecretInput object itself. + */ + public ValidateSecretInput withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property secretType in model ValidateSecretInput")); + } + if (secretSource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secretSource in model ValidateSecretInput")); + } else { + secretSource().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateSecretInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretType", this.secretType == null ? null : this.secretType.toString()); + jsonWriter.writeJsonField("secretSource", this.secretSource); + jsonWriter.writeStringField("secretVersion", this.secretVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateSecretInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateSecretInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidateSecretInput. + */ + public static ValidateSecretInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateSecretInput deserializedValidateSecretInput = new ValidateSecretInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretType".equals(fieldName)) { + deserializedValidateSecretInput.secretType = SecretType.fromString(reader.getString()); + } else if ("secretSource".equals(fieldName)) { + deserializedValidateSecretInput.secretSource = ResourceReference.fromJson(reader); + } else if ("secretVersion".equals(fieldName)) { + deserializedValidateSecretInput.secretVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateSecretInput; + }); + } +} 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 000000000000..9e714cf5c685 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretOutput.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; + +/** + * An immutable client-side representation of ValidateSecretOutput. + */ +public interface ValidateSecretOutput { + /** + * Gets the status property: The validation status. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the message property: Detailed error message. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner object. + * + * @return the inner object. + */ + ValidateSecretOutputInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafAction.java new file mode 100644 index 000000000000..f78c637c976f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafAction.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 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 a new instance of WafAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WafAction() { + } + + /** + * Creates or finds a WafAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafAction. + */ + public static WafAction fromString(String name) { + return fromString(name, WafAction.class); + } + + /** + * Gets known WafAction values. + * + * @return known WafAction values. + */ + public static Collection values() { + return values(WafAction.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafGranularity.java new file mode 100644 index 000000000000..d9f41ef14dc4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafGranularity.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import 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 a new instance of WafGranularity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WafGranularity() { + } + + /** + * Creates or finds a WafGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafGranularity. + */ + public static WafGranularity fromString(String name) { + return fromString(name, WafGranularity.class); + } + + /** + * Gets known WafGranularity values. + * + * @return known WafGranularity values. + */ + public static Collection values() { + return values(WafGranularity.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMatchVariable.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMatchVariable.java new file mode 100644 index 000000000000..f0e9009dc378 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMatchVariable.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Match variable to compare against. + */ +public final class WafMatchVariable extends ExpandableStringEnum { + /** + * Static value RemoteAddr for WafMatchVariable. + */ + public static final WafMatchVariable REMOTE_ADDR = fromString("RemoteAddr"); + + /** + * Static value SocketAddr for WafMatchVariable. + */ + public static final WafMatchVariable SOCKET_ADDR = fromString("SocketAddr"); + + /** + * Static value RequestMethod for WafMatchVariable. + */ + public static final WafMatchVariable REQUEST_METHOD = fromString("RequestMethod"); + + /** + * Static value RequestHeader for WafMatchVariable. + */ + public static final WafMatchVariable REQUEST_HEADER = fromString("RequestHeader"); + + /** + * Static value RequestUri for WafMatchVariable. + */ + public static final WafMatchVariable REQUEST_URI = fromString("RequestUri"); + + /** + * Static value QueryString for WafMatchVariable. + */ + public static final WafMatchVariable QUERY_STRING = fromString("QueryString"); + + /** + * Static value RequestBody for WafMatchVariable. + */ + public static final WafMatchVariable REQUEST_BODY = fromString("RequestBody"); + + /** + * Static value Cookies for WafMatchVariable. + */ + public static final WafMatchVariable COOKIES = fromString("Cookies"); + + /** + * Static value PostArgs for WafMatchVariable. + */ + public static final WafMatchVariable POST_ARGS = fromString("PostArgs"); + + /** + * Creates a new instance of WafMatchVariable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WafMatchVariable() { + } + + /** + * Creates or finds a WafMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafMatchVariable. + */ + public static WafMatchVariable fromString(String name) { + return fromString(name, WafMatchVariable.class); + } + + /** + * Gets known WafMatchVariable values. + * + * @return known WafMatchVariable values. + */ + public static Collection values() { + return values(WafMatchVariable.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetric.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetric.java new file mode 100644 index 000000000000..de638f07d3d8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetric.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 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 a new instance of WafMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WafMetric() { + } + + /** + * Creates or finds a WafMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafMetric. + */ + public static WafMetric fromString(String name) { + return fromString(name, WafMetric.class); + } + + /** + * Gets known WafMetric values. + * + * @return known WafMetric values. + */ + public static Collection values() { + return values(WafMetric.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsGranularity.java new file mode 100644 index 000000000000..3b2ff77663b1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsGranularity.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for WafMetricsGranularity. + */ +public final class WafMetricsGranularity extends ExpandableStringEnum { + /** + * Static value PT5M for WafMetricsGranularity. + */ + public static final WafMetricsGranularity PT5M = fromString("PT5M"); + + /** + * Static value PT1H for WafMetricsGranularity. + */ + public static final WafMetricsGranularity PT1H = fromString("PT1H"); + + /** + * Static value P1D for WafMetricsGranularity. + */ + public static final WafMetricsGranularity P1D = fromString("P1D"); + + /** + * Creates a new instance of WafMetricsGranularity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WafMetricsGranularity() { + } + + /** + * Creates or finds a WafMetricsGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafMetricsGranularity. + */ + public static WafMetricsGranularity fromString(String name) { + return fromString(name, WafMetricsGranularity.class); + } + + /** + * Gets known WafMetricsGranularity values. + * + * @return known WafMetricsGranularity values. + */ + public static Collection values() { + return values(WafMetricsGranularity.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponse.java new file mode 100644 index 000000000000..8e49d0a1395c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponse.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of WafMetricsResponse. + */ +public interface WafMetricsResponse { + /** + * Gets the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + OffsetDateTime dateTimeBegin(); + + /** + * Gets the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + OffsetDateTime dateTimeEnd(); + + /** + * Gets the granularity property: The granularity property. + * + * @return the granularity value. + */ + WafMetricsGranularity granularity(); + + /** + * Gets the series property: The series property. + * + * @return the series value. + */ + List series(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner object. + * + * @return the inner object. + */ + WafMetricsResponseInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItem.java new file mode 100644 index 000000000000..6fbca8080375 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItem.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The WafMetricsResponseSeriesItem model. + */ +@Fluent +public final class WafMetricsResponseSeriesItem implements JsonSerializable { + /* + * The metric property. + */ + private String metric; + + /* + * The unit property. + */ + private WafMetricsSeriesUnit unit; + + /* + * The groups property. + */ + private List groups; + + /* + * The data property. + */ + private List data; + + /** + * Creates an instance of WafMetricsResponseSeriesItem class. + */ + public WafMetricsResponseSeriesItem() { + } + + /** + * Get the metric property: The metric property. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: The metric property. + * + * @param metric the metric value to set. + * @return the WafMetricsResponseSeriesItem object itself. + */ + public WafMetricsResponseSeriesItem withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the unit property: The unit property. + * + * @return the unit value. + */ + public WafMetricsSeriesUnit unit() { + return this.unit; + } + + /** + * Set the unit property: The unit property. + * + * @param unit the unit value to set. + * @return the WafMetricsResponseSeriesItem object itself. + */ + public WafMetricsResponseSeriesItem withUnit(WafMetricsSeriesUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the groups property: The groups property. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The groups property. + * + * @param groups the groups value to set. + * @return the WafMetricsResponseSeriesItem object itself. + */ + public WafMetricsResponseSeriesItem withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the data property: The data property. + * + * @return the data value. + */ + public List data() { + return this.data; + } + + /** + * Set the data property: The data property. + * + * @param data the data value to set. + * @return the WafMetricsResponseSeriesItem object itself. + */ + public WafMetricsResponseSeriesItem withData(List data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + if (data() != null) { + data().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metric", this.metric); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + jsonWriter.writeArrayField("groups", this.groups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafMetricsResponseSeriesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafMetricsResponseSeriesItem if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WafMetricsResponseSeriesItem. + */ + public static WafMetricsResponseSeriesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafMetricsResponseSeriesItem deserializedWafMetricsResponseSeriesItem = new WafMetricsResponseSeriesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metric".equals(fieldName)) { + deserializedWafMetricsResponseSeriesItem.metric = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedWafMetricsResponseSeriesItem.unit = WafMetricsSeriesUnit.fromString(reader.getString()); + } else if ("groups".equals(fieldName)) { + List groups + = reader.readArray(reader1 -> WafMetricsResponseSeriesPropertiesItemsItem.fromJson(reader1)); + deserializedWafMetricsResponseSeriesItem.groups = groups; + } else if ("data".equals(fieldName)) { + List data + = reader.readArray(reader1 -> WafMetricsResponseSeriesItemData.fromJson(reader1)); + deserializedWafMetricsResponseSeriesItem.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedWafMetricsResponseSeriesItem; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemData.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemData.java new file mode 100644 index 000000000000..9d1e7dd39c12 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemData.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The WafMetricsResponseSeriesItemData model. + */ +@Fluent +public final class WafMetricsResponseSeriesItemData implements JsonSerializable { + /* + * The dateTime property. + */ + private OffsetDateTime dateTime; + + /* + * The value property. + */ + private Float value; + + /** + * Creates an instance of WafMetricsResponseSeriesItemData class. + */ + public WafMetricsResponseSeriesItemData() { + } + + /** + * Get the dateTime property: The dateTime property. + * + * @return the dateTime value. + */ + public OffsetDateTime dateTime() { + return this.dateTime; + } + + /** + * Set the dateTime property: The dateTime property. + * + * @param dateTime the dateTime value to set. + * @return the WafMetricsResponseSeriesItemData object itself. + */ + public WafMetricsResponseSeriesItemData withDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public Float value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the WafMetricsResponseSeriesItemData object itself. + */ + public WafMetricsResponseSeriesItemData withValue(Float value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dateTime", + this.dateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTime)); + jsonWriter.writeNumberField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafMetricsResponseSeriesItemData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafMetricsResponseSeriesItemData if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WafMetricsResponseSeriesItemData. + */ + public static WafMetricsResponseSeriesItemData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafMetricsResponseSeriesItemData deserializedWafMetricsResponseSeriesItemData + = new WafMetricsResponseSeriesItemData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dateTime".equals(fieldName)) { + deserializedWafMetricsResponseSeriesItemData.dateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("value".equals(fieldName)) { + deserializedWafMetricsResponseSeriesItemData.value = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedWafMetricsResponseSeriesItemData; + }); + } +} 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 000000000000..2b748419eac7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesPropertiesItemsItem.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The WafMetricsResponseSeriesPropertiesItemsItem model. + */ +@Fluent +public final class WafMetricsResponseSeriesPropertiesItemsItem + implements JsonSerializable { + /* + * The name property. + */ + private String name; + + /* + * The value property. + */ + private String value; + + /** + * Creates an instance of WafMetricsResponseSeriesPropertiesItemsItem class. + */ + public WafMetricsResponseSeriesPropertiesItemsItem() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the WafMetricsResponseSeriesPropertiesItemsItem object itself. + */ + public WafMetricsResponseSeriesPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the WafMetricsResponseSeriesPropertiesItemsItem object itself. + */ + public WafMetricsResponseSeriesPropertiesItemsItem withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafMetricsResponseSeriesPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafMetricsResponseSeriesPropertiesItemsItem if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WafMetricsResponseSeriesPropertiesItemsItem. + */ + public static WafMetricsResponseSeriesPropertiesItemsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafMetricsResponseSeriesPropertiesItemsItem deserializedWafMetricsResponseSeriesPropertiesItemsItem + = new WafMetricsResponseSeriesPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedWafMetricsResponseSeriesPropertiesItemsItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedWafMetricsResponseSeriesPropertiesItemsItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWafMetricsResponseSeriesPropertiesItemsItem; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsSeriesUnit.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsSeriesUnit.java new file mode 100644 index 000000000000..e9a80b6da208 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsSeriesUnit.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 java.util.Collection; + +/** + * Defines values for WafMetricsSeriesUnit. + */ +public final class WafMetricsSeriesUnit extends ExpandableStringEnum { + /** + * Static value count for WafMetricsSeriesUnit. + */ + public static final WafMetricsSeriesUnit COUNT = fromString("count"); + + /** + * Creates a new instance of WafMetricsSeriesUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WafMetricsSeriesUnit() { + } + + /** + * Creates or finds a WafMetricsSeriesUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafMetricsSeriesUnit. + */ + public static WafMetricsSeriesUnit fromString(String name) { + return fromString(name, WafMetricsSeriesUnit.class); + } + + /** + * Gets known WafMetricsSeriesUnit values. + * + * @return known WafMetricsSeriesUnit values. + */ + public static Collection values() { + return values(WafMetricsSeriesUnit.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingGroupBy.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingGroupBy.java new file mode 100644 index 000000000000..8c557c097352 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingGroupBy.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.util.ExpandableStringEnum; +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 a new instance of WafRankingGroupBy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WafRankingGroupBy() { + } + + /** + * Creates or finds a WafRankingGroupBy from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafRankingGroupBy. + */ + public static WafRankingGroupBy fromString(String name) { + return fromString(name, WafRankingGroupBy.class); + } + + /** + * Gets known WafRankingGroupBy values. + * + * @return known WafRankingGroupBy values. + */ + public static Collection values() { + return values(WafRankingGroupBy.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingType.java new file mode 100644 index 000000000000..3bf4ecb14458 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for WafRankingType. + */ +public final class WafRankingType extends ExpandableStringEnum { + /** + * Static value action for WafRankingType. + */ + public static final WafRankingType ACTION = fromString("action"); + + /** + * Static value ruleGroup for WafRankingType. + */ + public static final WafRankingType RULE_GROUP = fromString("ruleGroup"); + + /** + * Static value ruleId for WafRankingType. + */ + public static final WafRankingType RULE_ID = fromString("ruleId"); + + /** + * Static value userAgent for WafRankingType. + */ + public static final WafRankingType USER_AGENT = fromString("userAgent"); + + /** + * Static value clientIp for WafRankingType. + */ + public static final WafRankingType CLIENT_IP = fromString("clientIp"); + + /** + * Static value url for WafRankingType. + */ + public static final WafRankingType URL = fromString("url"); + + /** + * Static value countryOrRegion for WafRankingType. + */ + public static final WafRankingType COUNTRY_OR_REGION = fromString("countryOrRegion"); + + /** + * Static value ruleType for WafRankingType. + */ + public static final WafRankingType RULE_TYPE = fromString("ruleType"); + + /** + * Creates a new instance of WafRankingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WafRankingType() { + } + + /** + * Creates or finds a WafRankingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafRankingType. + */ + public static WafRankingType fromString(String name) { + return fromString(name, WafRankingType.class); + } + + /** + * Gets known WafRankingType values. + * + * @return known WafRankingType values. + */ + public static Collection values() { + return values(WafRankingType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponse.java new file mode 100644 index 000000000000..d8f005910e53 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponse.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.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 000000000000..353b454af92a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItem.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The WafRankingsResponseDataItem model. + */ +@Fluent +public final class WafRankingsResponseDataItem implements JsonSerializable { + /* + * The groupValues property. + */ + private List groupValues; + + /* + * The metrics property. + */ + private List metrics; + + /** + * Creates an instance of WafRankingsResponseDataItem class. + */ + public WafRankingsResponseDataItem() { + } + + /** + * Get the groupValues property: The groupValues property. + * + * @return the groupValues value. + */ + public List groupValues() { + return this.groupValues; + } + + /** + * Set the groupValues property: The groupValues property. + * + * @param groupValues the groupValues value to set. + * @return the WafRankingsResponseDataItem object itself. + */ + public WafRankingsResponseDataItem withGroupValues(List groupValues) { + this.groupValues = groupValues; + return this; + } + + /** + * Get the metrics property: The metrics property. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: The metrics property. + * + * @param metrics the metrics value to set. + * @return the WafRankingsResponseDataItem object itself. + */ + public WafRankingsResponseDataItem withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metrics() != null) { + metrics().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("groupValues", this.groupValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("metrics", this.metrics, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafRankingsResponseDataItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafRankingsResponseDataItem if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WafRankingsResponseDataItem. + */ + public static WafRankingsResponseDataItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafRankingsResponseDataItem deserializedWafRankingsResponseDataItem = new WafRankingsResponseDataItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupValues".equals(fieldName)) { + List groupValues = reader.readArray(reader1 -> reader1.getString()); + deserializedWafRankingsResponseDataItem.groupValues = groupValues; + } else if ("metrics".equals(fieldName)) { + List metrics + = reader.readArray(reader1 -> WafRankingsResponseDataItemMetric.fromJson(reader1)); + deserializedWafRankingsResponseDataItem.metrics = metrics; + } else { + reader.skipChildren(); + } + } + + return deserializedWafRankingsResponseDataItem; + }); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItemMetric.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItemMetric.java new file mode 100644 index 000000000000..d5fbffba14a0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItemMetric.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The WafRankingsResponseDataItemMetric model. + */ +@Fluent +public final class WafRankingsResponseDataItemMetric implements JsonSerializable { + /* + * The metric property. + */ + private String metric; + + /* + * The value property. + */ + private Long value; + + /* + * The percentage property. + */ + private Double percentage; + + /** + * Creates an instance of WafRankingsResponseDataItemMetric class. + */ + public WafRankingsResponseDataItemMetric() { + } + + /** + * Get the metric property: The metric property. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: The metric property. + * + * @param metric the metric value to set. + * @return the WafRankingsResponseDataItemMetric object itself. + */ + public WafRankingsResponseDataItemMetric withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public Long value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the WafRankingsResponseDataItemMetric object itself. + */ + public WafRankingsResponseDataItemMetric withValue(Long value) { + this.value = value; + return this; + } + + /** + * Get the percentage property: The percentage property. + * + * @return the percentage value. + */ + public Double percentage() { + return this.percentage; + } + + /** + * Set the percentage property: The percentage property. + * + * @param percentage the percentage value to set. + * @return the WafRankingsResponseDataItemMetric object itself. + */ + public WafRankingsResponseDataItemMetric withPercentage(Double percentage) { + this.percentage = percentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metric", this.metric); + jsonWriter.writeNumberField("value", this.value); + jsonWriter.writeNumberField("percentage", this.percentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafRankingsResponseDataItemMetric from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafRankingsResponseDataItemMetric if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WafRankingsResponseDataItemMetric. + */ + public static WafRankingsResponseDataItemMetric fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafRankingsResponseDataItemMetric deserializedWafRankingsResponseDataItemMetric + = new WafRankingsResponseDataItemMetric(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metric".equals(fieldName)) { + deserializedWafRankingsResponseDataItemMetric.metric = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedWafRankingsResponseDataItemMetric.value = reader.getNullable(JsonReader::getLong); + } else if ("percentage".equals(fieldName)) { + deserializedWafRankingsResponseDataItemMetric.percentage + = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedWafRankingsResponseDataItemMetric; + }); + } +} 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 000000000000..26345b4e839f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRuleType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import 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 a new instance of WafRuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WafRuleType() { + } + + /** + * Creates or finds a WafRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafRuleType. + */ + public static WafRuleType fromString(String name) { + return fromString(name, WafRuleType.class); + } + + /** + * Gets known WafRuleType values. + * + * @return known WafRuleType values. + */ + public static Collection values() { + return values(WafRuleType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/package-info.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/package-info.java new file mode 100644 index 000000000000..0231e1b29b28 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/package-info.java @@ -0,0 +1,9 @@ +// 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 000000000000..1a5a6c68a7f8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/package-info.java @@ -0,0 +1,9 @@ +// 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 000000000000..c13355c83533 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// 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; + opens com.azure.resourcemanager.cdn.generated.models to com.azure.core; +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cdn-generated/proxy-config.json b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cdn-generated/proxy-config.json new file mode 100644 index 000000000000..674d4846b43a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cdn-generated/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.cdn.generated.implementation.AfdCustomDomainsClientImpl$AfdCustomDomainsService"],["com.azure.resourcemanager.cdn.generated.implementation.AfdEndpointsClientImpl$AfdEndpointsService"],["com.azure.resourcemanager.cdn.generated.implementation.AfdOriginGroupsClientImpl$AfdOriginGroupsService"],["com.azure.resourcemanager.cdn.generated.implementation.AfdOriginsClientImpl$AfdOriginsService"],["com.azure.resourcemanager.cdn.generated.implementation.AfdProfilesClientImpl$AfdProfilesService"],["com.azure.resourcemanager.cdn.generated.implementation.CustomDomainsClientImpl$CustomDomainsService"],["com.azure.resourcemanager.cdn.generated.implementation.EdgeNodesClientImpl$EdgeNodesService"],["com.azure.resourcemanager.cdn.generated.implementation.EndpointsClientImpl$EndpointsService"],["com.azure.resourcemanager.cdn.generated.implementation.LogAnalyticsClientImpl$LogAnalyticsService"],["com.azure.resourcemanager.cdn.generated.implementation.ManagedRuleSetsClientImpl$ManagedRuleSetsService"],["com.azure.resourcemanager.cdn.generated.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cdn.generated.implementation.OriginGroupsClientImpl$OriginGroupsService"],["com.azure.resourcemanager.cdn.generated.implementation.OriginsClientImpl$OriginsService"],["com.azure.resourcemanager.cdn.generated.implementation.PoliciesClientImpl$PoliciesService"],["com.azure.resourcemanager.cdn.generated.implementation.ProfilesClientImpl$ProfilesService"],["com.azure.resourcemanager.cdn.generated.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.cdn.generated.implementation.ResourceUsagesClientImpl$ResourceUsagesService"],["com.azure.resourcemanager.cdn.generated.implementation.RoutesClientImpl$RoutesService"],["com.azure.resourcemanager.cdn.generated.implementation.RuleSetsClientImpl$RuleSetsService"],["com.azure.resourcemanager.cdn.generated.implementation.RulesClientImpl$RulesService"],["com.azure.resourcemanager.cdn.generated.implementation.SecretsClientImpl$SecretsService"],["com.azure.resourcemanager.cdn.generated.implementation.SecurityPoliciesClientImpl$SecurityPoliciesService"]] \ No newline at end of file diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cdn-generated/reflect-config.json b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cdn-generated/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cdn-generated/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/azure-resourcemanager-cdn-generated.properties b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/azure-resourcemanager-cdn-generated.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/resources/azure-resourcemanager-cdn-generated.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsCreateSamples.java new file mode 100644 index 000000000000..ac4575b62fee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsCreateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.AfdCertificateType; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdMinimumTlsVersion; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** + * Samples for AfdCustomDomains Create. + */ +public final class AfdCustomDomainsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_Create.json + */ + /** + * Sample code: AFDCustomDomains_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains() + .define("domain1") + .withExistingProfile("RG", "profile1") + .withHostname("www.someDomain.net") + .withTlsSettings(new AfdDomainHttpsParameters().withCertificateType(AfdCertificateType.MANAGED_CERTIFICATE) + .withMinimumTlsVersion(AfdMinimumTlsVersion.TLS12)) + .withAzureDnsZone(new ResourceReference().withId("")) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsDeleteSamples.java new file mode 100644 index 000000000000..07d3b9963db3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdCustomDomains Delete. + */ +public final class AfdCustomDomainsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_Delete.json + */ + /** + * Sample code: AFDCustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().delete("RG", "profile1", "domain1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsGetSamples.java new file mode 100644 index 000000000000..e194bb046777 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdCustomDomains Get. + */ +public final class AfdCustomDomainsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_Get.json + */ + /** + * Sample code: AFDCustomDomains_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().getWithResponse("RG", "profile1", "domain1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsListByProfileSamples.java new file mode 100644 index 000000000000..8516f9daab92 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsListByProfileSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdCustomDomains ListByProfile. + */ +public final class AfdCustomDomainsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_ListByProfile.json + */ + /** + * Sample code: AFDCustomDomains_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsRefreshValidationTokenSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsRefreshValidationTokenSamples.java new file mode 100644 index 000000000000..8fbc4510411b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsRefreshValidationTokenSamples.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.generated; + +/** + * Samples for AfdCustomDomains RefreshValidationToken. + */ +public final class AfdCustomDomainsRefreshValidationTokenSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * AFDCustomDomains_RefreshValidationToken.json + */ + /** + * Sample code: AFDCustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains() + .refreshValidationToken("RG", "profile1", "domain1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsUpdateSamples.java new file mode 100644 index 000000000000..7ca6d4eba453 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsUpdateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.AfdCertificateType; +import com.azure.resourcemanager.cdn.generated.models.AfdDomain; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdMinimumTlsVersion; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** + * Samples for AfdCustomDomains Update. + */ +public final class AfdCustomDomainsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDCustomDomains_Update.json + */ + /** + * Sample code: AFDCustomDomains_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdDomain resource = manager.afdCustomDomains() + .getWithResponse("RG", "profile1", "domain1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTlsSettings(new AfdDomainHttpsParameters().withCertificateType(AfdCertificateType.CUSTOMER_CERTIFICATE) + .withMinimumTlsVersion(AfdMinimumTlsVersion.TLS12)) + .withAzureDnsZone(new ResourceReference().withId("")) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsCreateSamples.java new file mode 100644 index 000000000000..1e0e24adb017 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsCreateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdEndpoints Create. + */ +public final class AfdEndpointsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_Create.json + */ + /** + * Sample code: AFDEndpoints_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints() + .define("endpoint1") + .withRegion((String) null) + .withExistingProfile("RG", "profile1") + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsDeleteSamples.java new file mode 100644 index 000000000000..dbb60ac04e97 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdEndpoints Delete. + */ +public final class AfdEndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_Delete.json + */ + /** + * Sample code: AFDEndpoints_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().delete("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsGetSamples.java new file mode 100644 index 000000000000..ca27649ce896 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdEndpoints Get. + */ +public final class AfdEndpointsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_Get.json + */ + /** + * Sample code: AFDEndpoints_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().getWithResponse("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListByProfileSamples.java new file mode 100644 index 000000000000..df35cbd292b0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListByProfileSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdEndpoints ListByProfile. + */ +public final class AfdEndpointsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_ListByProfile.json + */ + /** + * Sample code: AFDEndpoints_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListResourceUsageSamples.java new file mode 100644 index 000000000000..6dff7c3dd099 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListResourceUsageSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdEndpoints ListResourceUsage. + */ +public final class AfdEndpointsListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_ListResourceUsage.json + */ + /** + * Sample code: AFDEndpoints_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().listResourceUsage("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsPurgeContentSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsPurgeContentSamples.java new file mode 100644 index 000000000000..6b6d5dc8c4ac --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsPurgeContentSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import java.util.Arrays; + +/** + * Samples for AfdEndpoints PurgeContent. + */ +public final class AfdEndpointsPurgeContentSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_PurgeContent.json + */ + /** + * Sample code: AFDEndpoints_PurgeContent. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsPurgeContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints() + .purgeContent("RG", "profile1", "endpoint1", + new AfdPurgeParameters().withContentPaths(Arrays.asList("/folder1")) + .withDomains(Arrays.asList("endpoint1-abcdefghijklmnop.z01.azurefd.net")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsUpdateSamples.java new file mode 100644 index 000000000000..13fbfc96abb2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoint; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AfdEndpoints Update. + */ +public final class AfdEndpointsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_Update.json + */ + /** + * Sample code: AFDEndpoints_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdEndpoint resource = manager.afdEndpoints() + .getWithResponse("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf()).withEnabledState(EnabledState.ENABLED).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsValidateCustomDomainSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsValidateCustomDomainSamples.java new file mode 100644 index 000000000000..5f5fc814cf46 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsValidateCustomDomainSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** + * Samples for AfdEndpoints ValidateCustomDomain. + */ +public final class AfdEndpointsValidateCustomDomainSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDEndpoints_ValidateCustomDomain. + * json + */ + /** + * Sample code: Endpoints_ValidateCustomDomain. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsValidateCustomDomain(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints() + .validateCustomDomainWithResponse("RG", "profile1", "endpoint1", + new ValidateCustomDomainInput().withHostname("www.someDomain.com"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsCreateSamples.java new file mode 100644 index 000000000000..a55b85c25b78 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsCreateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; + +/** + * Samples for AfdOriginGroups Create. + */ +public final class AfdOriginGroupsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_Create.json + */ + /** + * Sample code: AFDOriginGroups_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups() + .define("origingroup1") + .withExistingProfile("RG", "profile1") + .withLoadBalancingSettings(new LoadBalancingSettingsParameters().withSampleSize(3) + .withSuccessfulSamplesRequired(3) + .withAdditionalLatencyInMilliseconds(1000)) + .withHealthProbeSettings(new HealthProbeParameters().withProbePath("/path2") + .withProbeRequestType(HealthProbeRequestType.NOT_SET) + .withProbeProtocol(ProbeProtocol.NOT_SET) + .withProbeIntervalInSeconds(10)) + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes(5) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsDeleteSamples.java new file mode 100644 index 000000000000..936ab4a70ad1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdOriginGroups Delete. + */ +public final class AfdOriginGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_Delete.json + */ + /** + * Sample code: AFDOriginGroups_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().delete("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsGetSamples.java new file mode 100644 index 000000000000..6568f428c54a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdOriginGroups Get. + */ +public final class AfdOriginGroupsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_Get.json + */ + /** + * Sample code: AFDOriginGroups_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().getWithResponse("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListByProfileSamples.java new file mode 100644 index 000000000000..086812918ed2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListByProfileSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdOriginGroups ListByProfile. + */ +public final class AfdOriginGroupsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_ListByProfile.json + */ + /** + * Sample code: AFDOriginGroups_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListResourceUsageSamples.java new file mode 100644 index 000000000000..e891fb994c69 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListResourceUsageSamples.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.generated; + +/** + * Samples for AfdOriginGroups ListResourceUsage. + */ +public final class AfdOriginGroupsListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_ListResourceUsage. + * json + */ + /** + * Sample code: AFDOriginGroups_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().listResourceUsage("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsUpdateSamples.java new file mode 100644 index 000000000000..98e53e4a3b09 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; + +/** + * Samples for AfdOriginGroups Update. + */ +public final class AfdOriginGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOriginGroups_Update.json + */ + /** + * Sample code: AFDOriginGroups_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdOriginGroup resource = manager.afdOriginGroups() + .getWithResponse("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withLoadBalancingSettings(new LoadBalancingSettingsParameters().withSampleSize(3) + .withSuccessfulSamplesRequired(3) + .withAdditionalLatencyInMilliseconds(1000)) + .withHealthProbeSettings(new HealthProbeParameters().withProbePath("/path2") + .withProbeRequestType(HealthProbeRequestType.NOT_SET) + .withProbeProtocol(ProbeProtocol.NOT_SET) + .withProbeIntervalInSeconds(10)) + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes(5) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsCreateSamples.java new file mode 100644 index 000000000000..1624f69f4647 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsCreateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.EnabledState; + +/** + * Samples for AfdOrigins Create. + */ +public final class AfdOriginsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_Create.json + */ + /** + * Sample code: AFDOrigins_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins() + .define("origin1") + .withExistingOriginGroup("RG", "profile1", "origingroup1") + .withHostname("host1.blob.core.windows.net") + .withHttpPort(80) + .withHttpsPort(443) + .withOriginHostHeader("host1.foo.com") + .withEnabledState(EnabledState.ENABLED) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsDeleteSamples.java new file mode 100644 index 000000000000..4110b2c79936 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdOrigins Delete. + */ +public final class AfdOriginsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_Delete.json + */ + /** + * Sample code: AFDOrigins_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().delete("RG", "profile1", "origingroup1", "origin1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsGetSamples.java new file mode 100644 index 000000000000..e15ee563063e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsGetSamples.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.generated; + +/** + * Samples for AfdOrigins Get. + */ +public final class AfdOriginsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_Get.json + */ + /** + * Sample code: AFDOrigins_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins() + .getWithResponse("RG", "profile1", "origingroup1", "origin1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsListByOriginGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsListByOriginGroupSamples.java new file mode 100644 index 000000000000..caaf0a7861bc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsListByOriginGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdOrigins ListByOriginGroup. + */ +public final class AfdOriginsListByOriginGroupSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_ListByOriginGroup.json + */ + /** + * Sample code: AFDOrigins_ListByOriginGroup. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsListByOriginGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().listByOriginGroup("RG", "profile1", "origingroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsUpdateSamples.java new file mode 100644 index 000000000000..a768fea666f8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsUpdateSamples.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.generated; + +import com.azure.resourcemanager.cdn.generated.models.AfdOrigin; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; + +/** + * Samples for AfdOrigins Update. + */ +public final class AfdOriginsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDOrigins_Update.json + */ + /** + * Sample code: AFDOrigins_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdOrigin resource = manager.afdOrigins() + .getWithResponse("RG", "profile1", "origingroup1", "origin1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withHostname("host1.blob.core.windows.net") + .withHttpPort(80) + .withHttpsPort(443) + .withEnabledState(EnabledState.ENABLED) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckEndpointNameAvailabilitySamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckEndpointNameAvailabilitySamples.java new file mode 100644 index 000000000000..c32bae27fc60 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckEndpointNameAvailabilitySamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** + * Samples for AfdProfiles CheckEndpointNameAvailability. + */ +public final class AfdProfilesCheckEndpointNameAvailabilitySamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * AFDProfiles_CheckEndpointNameAvailability.json + */ + /** + * Sample code: CheckEndpointNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkEndpointNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles() + .checkEndpointNameAvailabilityWithResponse("myResourceGroup", "profile1", + new CheckEndpointNameAvailabilityInput().withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_AFD_ENDPOINTS) + .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckHostnameAvailabilitySamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckHostnameAvailabilitySamples.java new file mode 100644 index 000000000000..e7fd03ad2825 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckHostnameAvailabilitySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; + +/** + * Samples for AfdProfiles CheckHostnameAvailability. + */ +public final class AfdProfilesCheckHostnameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDProfiles_CheckHostNameAvailability + * .json + */ + /** + * Sample code: AFDProfiles_CheckHostNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void + aFDProfilesCheckHostNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles() + .checkHostnameAvailabilityWithResponse("RG", "profile1", + new CheckHostnameAvailabilityInput().withHostname("www.someDomain.net"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesListResourceUsageSamples.java new file mode 100644 index 000000000000..1c7438295366 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesListResourceUsageSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for AfdProfiles ListResourceUsage. + */ +public final class AfdProfilesListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDProfiles_ListResourceUsage.json + */ + /** + * Sample code: AFDProfiles_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles().listResourceUsage("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesUpgradeSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesUpgradeSamples.java new file mode 100644 index 000000000000..7b367acd3b07 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesUpgradeSamples.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.generated; + +import com.azure.resourcemanager.cdn.generated.models.ProfileChangeSkuWafMapping; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** + * Samples for AfdProfiles Upgrade. + */ +public final class AfdProfilesUpgradeSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDProfiles_Upgrade.json + */ + /** + * Sample code: AFDProfiles_Upgrade. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesUpgrade(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles() + .upgrade("RG", "profile1", + new ProfileUpgradeParameters().withWafMappingList(Arrays.asList(new ProfileChangeSkuWafMapping() + .withSecurityPolicyName("securityPolicy1") + .withChangeToWafPolicy(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/waf2")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesValidateSecretSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesValidateSecretSamples.java new file mode 100644 index 000000000000..0b6509a98ba8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesValidateSecretSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecretType; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; + +/** + * Samples for AfdProfiles ValidateSecret. + */ +public final class AfdProfilesValidateSecretSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/AFDProfiles_ValidateSecret.json + */ + /** + * Sample code: Validate_Secret. + * + * @param manager Entry point to CdnManager. + */ + public static void validateSecret(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles() + .validateSecretWithResponse("RG", "profile1", new ValidateSecretInput() + .withSecretType(SecretType.CUSTOMER_CERTIFICATE) + .withSecretSource(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/certificate/certName")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsCreateSamples.java new file mode 100644 index 000000000000..813c7b693265 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsCreateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for CustomDomains Create. + */ +public final class CustomDomainsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_Create.json + */ + /** + * Sample code: CustomDomains_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .define("www-someDomain-net") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHostname("www.someDomain.net") + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDeleteSamples.java new file mode 100644 index 000000000000..7ebceb5ad604 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDeleteSamples.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.generated; + +/** + * Samples for CustomDomains Delete. + */ +public final class CustomDomainsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_Delete.json + */ + /** + * Sample code: CustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .delete("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDisableCustomHttpsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDisableCustomHttpsSamples.java new file mode 100644 index 000000000000..19e216dc402a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDisableCustomHttpsSamples.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.generated; + +/** + * Samples for CustomDomains DisableCustomHttps. + */ +public final class CustomDomainsDisableCustomHttpsSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_DisableCustomHttps.json + */ + /** + * Sample code: CustomDomains_DisableCustomHttps. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsDisableCustomHttps(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .disableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsEnableCustomHttpsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsEnableCustomHttpsSamples.java new file mode 100644 index 000000000000..6da4e40c79ef --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsEnableCustomHttpsSamples.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.generated; + +/** + * Samples for CustomDomains EnableCustomHttps. + */ +public final class CustomDomainsEnableCustomHttpsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json + */ + /** + * Sample code: CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsEnableCustomHttpsUsingCDNManagedCertificate( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .enableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * CustomDomains_EnableCustomHttpsUsingBYOC.json + */ + /** + * Sample code: CustomDomains_EnableCustomHttpsUsingYourOwnCertificate. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsEnableCustomHttpsUsingYourOwnCertificate( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .enableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsGetSamples.java new file mode 100644 index 000000000000..bf0c3846a820 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsGetSamples.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.generated; + +/** + * Samples for CustomDomains Get. + */ +public final class CustomDomainsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_Get.json + */ + /** + * Sample code: CustomDomains_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains() + .getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsListByEndpointSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsListByEndpointSamples.java new file mode 100644 index 000000000000..2ec69c61efe0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsListByEndpointSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for CustomDomains ListByEndpoint. + */ +public final class CustomDomainsListByEndpointSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CustomDomains_ListByEndpoint.json + */ + /** + * Sample code: CustomDomains_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().listByEndpoint("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EdgeNodesListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EdgeNodesListSamples.java new file mode 100644 index 000000000000..1bd61332be88 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EdgeNodesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for EdgeNodes List. + */ +public final class EdgeNodesListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/EdgeNodes_List.json + */ + /** + * Sample code: EdgeNodes_List. + * + * @param manager Entry point to CdnManager. + */ + public static void edgeNodesList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.edgeNodes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsCreateSamples.java new file mode 100644 index 000000000000..9016e5aaa1b5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsCreateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Endpoints Create. + */ +public final class EndpointsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Create.json + */ + /** + * Sample code: Endpoints_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints() + .define("endpoint1") + .withRegion((String) null) + .withExistingProfile("RG", "profile1") + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsDeleteSamples.java new file mode 100644 index 000000000000..ddba4e26b093 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Endpoints Delete. + */ +public final class EndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Delete.json + */ + /** + * Sample code: Endpoints_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().delete("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsGetSamples.java new file mode 100644 index 000000000000..a87de292da90 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Endpoints Get. + */ +public final class EndpointsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Get.json + */ + /** + * Sample code: Endpoints_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().getWithResponse("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListByProfileSamples.java new file mode 100644 index 000000000000..10d80b1d06cf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListByProfileSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Endpoints ListByProfile. + */ +public final class EndpointsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_ListByProfile.json + */ + /** + * Sample code: Endpoints_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListResourceUsageSamples.java new file mode 100644 index 000000000000..0b3cf8c5cb68 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListResourceUsageSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Endpoints ListResourceUsage. + */ +public final class EndpointsListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_ListResourceUsage.json + */ + /** + * Sample code: Endpoints_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().listResourceUsage("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsLoadContentSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsLoadContentSamples.java new file mode 100644 index 000000000000..83ca01823bf1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsLoadContentSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import java.util.Arrays; + +/** + * Samples for Endpoints LoadContent. + */ +public final class EndpointsLoadContentSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_LoadContent.json + */ + /** + * Sample code: Endpoints_LoadContent. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsLoadContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints() + .loadContent("RG", "profile1", "endpoint1", + new LoadParameters().withContentPaths(Arrays.asList("/folder1")), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsPurgeContentSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsPurgeContentSamples.java new file mode 100644 index 000000000000..a8f512f28e0e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsPurgeContentSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import java.util.Arrays; + +/** + * Samples for Endpoints PurgeContent. + */ +public final class EndpointsPurgeContentSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_PurgeContent.json + */ + /** + * Sample code: Endpoints_PurgeContent. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsPurgeContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints() + .purgeContent("RG", "profile1", "endpoint1", + new PurgeParameters().withContentPaths(Arrays.asList("/folder1")), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStartSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStartSamples.java new file mode 100644 index 000000000000..403383bf1633 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStartSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Endpoints Start. + */ +public final class EndpointsStartSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Start.json + */ + /** + * Sample code: Endpoints_Start. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsStart(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().start("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStopSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStopSamples.java new file mode 100644 index 000000000000..3a5d01260256 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStopSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Endpoints Stop. + */ +public final class EndpointsStopSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Stop.json + */ + /** + * Sample code: Endpoints_Stop. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsStop(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().stop("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsUpdateSamples.java new file mode 100644 index 000000000000..8d06e1e8f3e4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsUpdateSamples.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.generated; + +import com.azure.resourcemanager.cdn.generated.models.Endpoint; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Endpoints Update. + */ +public final class EndpointsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_Update.json + */ + /** + * Sample code: Endpoints_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Endpoint resource = manager.endpoints() + .getWithResponse("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "Tag1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsValidateCustomDomainSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsValidateCustomDomainSamples.java new file mode 100644 index 000000000000..fb17b8c0c5ab --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsValidateCustomDomainSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** + * Samples for Endpoints ValidateCustomDomain. + */ +public final class EndpointsValidateCustomDomainSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Endpoints_ValidateCustomDomain.json + */ + /** + * Sample code: Endpoints_ValidateCustomDomain. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsValidateCustomDomain(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints() + .validateCustomDomainWithResponse("RG", "profile1", "endpoint1", + new ValidateCustomDomainInput().withHostname("www.someDomain.com"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsLocationsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsLocationsSamples.java new file mode 100644 index 000000000000..0da2149f3ec3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsLocationsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for LogAnalytics GetLogAnalyticsLocations. + */ +public final class LogAnalyticsGetLogAnalyticsLocationsSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/LogAnalytics_GetLogAnalyticsLocations + * .json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsLocations. + * + * @param manager Entry point to CdnManager. + */ + public static void + logAnalyticsGetLogAnalyticsLocations(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics().getLogAnalyticsLocationsWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsMetricsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsMetricsSamples.java new file mode 100644 index 000000000000..0e206e22562e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsMetricsSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for LogAnalytics GetLogAnalyticsMetrics. + */ +public final class LogAnalyticsGetLogAnalyticsMetricsSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/LogAnalytics_GetLogAnalyticsMetrics. + * json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsMetrics. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsMetrics(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics() + .getLogAnalyticsMetricsWithResponse("RG", "profile1", Arrays.asList(LogMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T04:30:00.000Z"), OffsetDateTime.parse("2020-11-04T05:00:00.000Z"), + LogMetricsGranularity.PT5M, Arrays.asList("customdomain1.azurecdn.net", "customdomain2.azurecdn.net"), + Arrays.asList("https"), Arrays.asList(LogMetricsGroupBy.PROTOCOL), null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsRankingsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsRankingsSamples.java new file mode 100644 index 000000000000..01b5f57e1db0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsRankingsSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for LogAnalytics GetLogAnalyticsRankings. + */ +public final class LogAnalyticsGetLogAnalyticsRankingsSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/LogAnalytics_GetLogAnalyticsRankings. + * json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsRankings. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsRankings(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics() + .getLogAnalyticsRankingsWithResponse("RG", "profile1", Arrays.asList(LogRanking.URL), + Arrays.asList(LogRankingMetric.CLIENT_REQUEST_COUNT), 5, + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsResourcesSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsResourcesSamples.java new file mode 100644 index 000000000000..d196beb84152 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsResourcesSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for LogAnalytics GetLogAnalyticsResources. + */ +public final class LogAnalyticsGetLogAnalyticsResourcesSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/LogAnalytics_GetLogAnalyticsResources + * .json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsResources. + * + * @param manager Entry point to CdnManager. + */ + public static void + logAnalyticsGetLogAnalyticsResources(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics().getLogAnalyticsResourcesWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsMetricsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsMetricsSamples.java new file mode 100644 index 000000000000..f1065255bc69 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsMetricsSamples.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.generated; + +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for LogAnalytics GetWafLogAnalyticsMetrics. + */ +public final class LogAnalyticsGetWafLogAnalyticsMetricsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * LogAnalytics_GetWafLogAnalyticsMetrics.json + */ + /** + * Sample code: LogAnalytics_GetWafLogAnalyticsMetrics. + * + * @param manager Entry point to CdnManager. + */ + public static void + logAnalyticsGetWafLogAnalyticsMetrics(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics() + .getWafLogAnalyticsMetricsWithResponse("RG", "profile1", Arrays.asList(WafMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + WafGranularity.PT5M, Arrays.asList(WafAction.BLOCK, WafAction.LOG), null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsRankingsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsRankingsSamples.java new file mode 100644 index 000000000000..73718548b222 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsRankingsSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for LogAnalytics GetWafLogAnalyticsRankings. + */ +public final class LogAnalyticsGetWafLogAnalyticsRankingsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * LogAnalytics_GetWafLogAnalyticsRankings.json + */ + /** + * Sample code: LogAnalytics_GetWafLogAnalyticsRankings. + * + * @param manager Entry point to CdnManager. + */ + public static void + logAnalyticsGetWafLogAnalyticsRankings(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics() + .getWafLogAnalyticsRankingsWithResponse("RG", "profile1", Arrays.asList(WafMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), 5, + Arrays.asList(WafRankingType.RULE_ID), null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ManagedRuleSetsListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ManagedRuleSetsListSamples.java new file mode 100644 index 000000000000..d96281280f9e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ManagedRuleSetsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for ManagedRuleSets List. + */ +public final class ManagedRuleSetsListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafListManagedRuleSets.json + */ + /** + * Sample code: List Policies in a Resource Group. + * + * @param manager Entry point to CdnManager. + */ + public static void listPoliciesInAResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.managedRuleSets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OperationsListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OperationsListSamples.java new file mode 100644 index 000000000000..5bb5f5aaac01 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to CdnManager. + */ + public static void operationsList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsCreateSamples.java new file mode 100644 index 000000000000..28586cbdb9b5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsCreateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedDetectedErrorTypes; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.util.Arrays; + +/** + * Samples for OriginGroups Create. + */ +public final class OriginGroupsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_Create.json + */ + /** + * Sample code: OriginGroups_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups() + .define("origingroup1") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHealthProbeSettings(new HealthProbeParameters().withProbePath("/health.aspx") + .withProbeRequestType(HealthProbeRequestType.GET) + .withProbeProtocol(ProbeProtocol.HTTP) + .withProbeIntervalInSeconds(120)) + .withOrigins(Arrays.asList(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"))) + .withResponseBasedOriginErrorDetectionSettings(new ResponseBasedOriginErrorDetectionParameters() + .withResponseBasedDetectedErrorTypes(ResponseBasedDetectedErrorTypes.TCP_ERRORS_ONLY) + .withResponseBasedFailoverThresholdPercentage(10)) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsDeleteSamples.java new file mode 100644 index 000000000000..0e1239df29f6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for OriginGroups Delete. + */ +public final class OriginGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_Delete.json + */ + /** + * Sample code: OriginGroups_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().delete("RG", "profile1", "endpoint1", "originGroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsGetSamples.java new file mode 100644 index 000000000000..e7f51d8607cc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsGetSamples.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.generated; + +/** + * Samples for OriginGroups Get. + */ +public final class OriginGroupsGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_Get.json + */ + /** + * Sample code: OriginGroups_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups() + .getWithResponse("RG", "profile1", "endpoint1", "originGroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsListByEndpointSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsListByEndpointSamples.java new file mode 100644 index 000000000000..7b2e639d6db8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsListByEndpointSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for OriginGroups ListByEndpoint. + */ +public final class OriginGroupsListByEndpointSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_ListByEndpoint.json + */ + /** + * Sample code: OriginsGroups_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void originsGroupsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().listByEndpoint("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsUpdateSamples.java new file mode 100644 index 000000000000..405859aace9c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.OriginGroup; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** + * Samples for OriginGroups Update. + */ +public final class OriginGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/OriginGroups_Update.json + */ + /** + * Sample code: OriginGroups_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + OriginGroup resource = manager.originGroups() + .getWithResponse("RG", "profile1", "endpoint1", "originGroup1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withHealthProbeSettings(new HealthProbeParameters().withProbePath("/health.aspx") + .withProbeRequestType(HealthProbeRequestType.GET) + .withProbeProtocol(ProbeProtocol.HTTP) + .withProbeIntervalInSeconds(120)) + .withOrigins(Arrays.asList(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2"))) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsCreateSamples.java new file mode 100644 index 000000000000..c944d8dc6321 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsCreateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Origins Create. + */ +public final class OriginsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_Create.json + */ + /** + * Sample code: Origins_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void originsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins() + .define("www-someDomain-net") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHostname("www.someDomain.net") + .withHttpPort(80) + .withHttpsPort(443) + .withOriginHostHeader("www.someDomain.net") + .withPriority(1) + .withWeight(50) + .withEnabled(true) + .withPrivateLinkResourceId( + "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Network/privateLinkServices/pls1") + .withPrivateLinkLocation("eastus") + .withPrivateLinkApprovalMessage("Please approve the connection request for this Private Link") + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsDeleteSamples.java new file mode 100644 index 000000000000..bcc1a97116bc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Origins Delete. + */ +public final class OriginsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_Delete.json + */ + /** + * Sample code: Origins_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void originsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().delete("RG", "profile1", "endpoint1", "origin1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsGetSamples.java new file mode 100644 index 000000000000..bd44c30dd72d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Origins Get. + */ +public final class OriginsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_Get.json + */ + /** + * Sample code: Origins_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void originsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins() + .getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsListByEndpointSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsListByEndpointSamples.java new file mode 100644 index 000000000000..0407380f308b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsListByEndpointSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Origins ListByEndpoint. + */ +public final class OriginsListByEndpointSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_ListByEndpoint.json + */ + /** + * Sample code: Origins_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void originsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().listByEndpoint("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsUpdateSamples.java new file mode 100644 index 000000000000..dc5e4ea9c4e8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsUpdateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.Origin; + +/** + * Samples for Origins Update. + */ +public final class OriginsUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Origins_Update.json + */ + /** + * Sample code: Origins_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void originsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Origin resource = manager.origins() + .getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withHttpPort(42) + .withHttpsPort(43) + .withOriginHostHeader("www.someDomain2.net") + .withPriority(1) + .withWeight(50) + .withEnabled(true) + .withPrivateLinkAlias("APPSERVER.d84e61f0-0870-4d24-9746-7438fa0019d1.westus2.azure.privatelinkservice") + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesCreateOrUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f02e6813ca5c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesCreateOrUpdateSamples.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ActionType; +import com.azure.resourcemanager.cdn.generated.models.CustomRule; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleEnabledState; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleList; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleEnabledState; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupOverride; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleOverride; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSet; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetList; +import com.azure.resourcemanager.cdn.generated.models.MatchCondition; +import com.azure.resourcemanager.cdn.generated.models.Operator; +import com.azure.resourcemanager.cdn.generated.models.PolicySettings; +import com.azure.resourcemanager.cdn.generated.models.PolicySettingsDefaultCustomBlockResponseStatusCode; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRule; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRuleList; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; +import com.azure.resourcemanager.cdn.generated.models.TransformType; +import com.azure.resourcemanager.cdn.generated.models.WafMatchVariable; +import java.util.Arrays; + +/** + * Samples for Policies CreateOrUpdate. + */ +public final class PoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafPolicyCreateOrUpdate.json + */ + /** + * Sample code: Creates specific policy. + * + * @param manager Entry point to CdnManager. + */ + public static void createsSpecificPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies() + .define("MicrosoftCdnWafPolicy") + .withRegion("WestUs") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.STANDARD_MICROSOFT)) + .withPolicySettings(new PolicySettings().withDefaultRedirectUrl("http://www.bing.com") + .withDefaultCustomBlockResponseStatusCode( + PolicySettingsDefaultCustomBlockResponseStatusCode.TWO_ZERO_ZERO) + .withDefaultCustomBlockResponseBody( + "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==")) + .withRateLimitRules(new RateLimitRuleList().withRules(Arrays.asList(new RateLimitRule() + .withName("RateLimitRule1") + .withEnabledState(CustomRuleEnabledState.ENABLED) + .withPriority(1) + .withMatchConditions(Arrays.asList(new MatchCondition().withMatchVariable(WafMatchVariable.REMOTE_ADDR) + .withOperator(Operator.IPMATCH) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("192.168.1.0/24", "10.0.0.0/24")) + .withTransforms(Arrays.asList()))) + .withAction(ActionType.BLOCK) + .withRateLimitThreshold(1000) + .withRateLimitDurationInMinutes(0)))) + .withCustomRules(new CustomRuleList().withRules(Arrays.asList(new CustomRule().withName("CustomRule1") + .withEnabledState(CustomRuleEnabledState.ENABLED) + .withPriority(2) + .withMatchConditions(Arrays.asList( + new MatchCondition().withMatchVariable(WafMatchVariable.REMOTE_ADDR) + .withOperator(Operator.GEO_MATCH) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("CH")) + .withTransforms(Arrays.asList()), + new MatchCondition().withMatchVariable(WafMatchVariable.REQUEST_HEADER) + .withSelector("UserAgent") + .withOperator(Operator.CONTAINS) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("windows")) + .withTransforms(Arrays.asList()), + new MatchCondition().withMatchVariable(WafMatchVariable.QUERY_STRING) + .withSelector("search") + .withOperator(Operator.CONTAINS) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("")) + .withTransforms(Arrays.asList(TransformType.URL_DECODE, TransformType.LOWERCASE)))) + .withAction(ActionType.BLOCK)))) + .withManagedRules(new ManagedRuleSetList() + .withManagedRuleSets(Arrays.asList(new ManagedRuleSet().withRuleSetType("DefaultRuleSet") + .withRuleSetVersion("preview-1.0") + .withRuleGroupOverrides(Arrays.asList(new ManagedRuleGroupOverride().withRuleGroupName("Group1") + .withRules(Arrays.asList( + new ManagedRuleOverride().withRuleId("GROUP1-0001") + .withEnabledState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.REDIRECT), + new ManagedRuleOverride().withRuleId("GROUP1-0002") + .withEnabledState(ManagedRuleEnabledState.DISABLED)))))))) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesDeleteSamples.java new file mode 100644 index 000000000000..5819bbecd592 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Policies Delete. + */ +public final class PoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafPolicyDelete.json + */ + /** + * Sample code: Delete protection policy. + * + * @param manager Entry point to CdnManager. + */ + public static void deleteProtectionPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().deleteByResourceGroupWithResponse("rg1", "Policy1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesGetByResourceGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6169e9474a43 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Policies GetByResourceGroup. + */ +public final class PoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafPolicyGet.json + */ + /** + * Sample code: Get Policy. + * + * @param manager Entry point to CdnManager. + */ + public static void getPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies() + .getByResourceGroupWithResponse("rg1", "MicrosoftCdnWafPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesListByResourceGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesListByResourceGroupSamples.java new file mode 100644 index 000000000000..cc1be521c7f3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Policies ListByResourceGroup. + */ +public final class PoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafListPolicies.json + */ + /** + * Sample code: List Policies in a Resource Group. + * + * @param manager Entry point to CdnManager. + */ + public static void listPoliciesInAResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesUpdateSamples.java new file mode 100644 index 000000000000..532325fb1bd3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesUpdateSamples.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.generated; + +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Policies Update. + */ +public final class PoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/WafPatchPolicy.json + */ + /** + * Sample code: Creates specific policy. + * + * @param manager Entry point to CdnManager. + */ + public static void createsSpecificPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + CdnWebApplicationFirewallPolicy resource = manager.policies() + .getByResourceGroupWithResponse("rg1", "MicrosoftCdnWafPolicy", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("foo", "bar")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCanMigrateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCanMigrateSamples.java new file mode 100644 index 000000000000..6e1312ba96a4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCanMigrateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** + * Samples for Profiles CanMigrate. + */ +public final class ProfilesCanMigrateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_CanMigrate.json + */ + /** + * Sample code: Profiles_CanMigrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCanMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .canMigrate("RG", + new CanMigrateParameters().withClassicResourceReference(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCdnCanMigrateToAfdSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCdnCanMigrateToAfdSamples.java new file mode 100644 index 000000000000..636223e3401b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCdnCanMigrateToAfdSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles CdnCanMigrateToAfd. + */ +public final class ProfilesCdnCanMigrateToAfdSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CdnProfiles_CanMigrate.json + */ + /** + * Sample code: Profiles_CdnCanMigrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCdnCanMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().cdnCanMigrateToAfd("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCdnMigrateToAfdSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCdnMigrateToAfdSamples.java new file mode 100644 index 000000000000..2ff08f965bb1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCdnMigrateToAfdSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.CdnMigrationToAfdParameters; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** + * Samples for Profiles CdnMigrateToAfd. + */ +public final class ProfilesCdnMigrateToAfdSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CdnProfiles_Migrate.json + */ + /** + * Sample code: Profiles_CdnMigrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCdnMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .cdnMigrateToAfd("RG", "profile1", + new CdnMigrationToAfdParameters().withSku(new Sku().withName(SkuName.STANDARD_AZURE_FRONT_DOOR)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCreateSamples.java new file mode 100644 index 000000000000..48175125ace2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCreateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** + * Samples for Profiles Create. + */ +public final class ProfilesCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Create.json + */ + /** + * Sample code: Profiles_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .define("profile1") + .withRegion("global") + .withExistingResourceGroup("RG") + .withSku(new Sku().withName(SkuName.PREMIUM_AZURE_FRONT_DOOR)) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesDeleteSamples.java new file mode 100644 index 000000000000..8f56804b277f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles Delete. + */ +public final class ProfilesDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Delete.json + */ + /** + * Sample code: Profiles_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().delete("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGenerateSsoUriSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGenerateSsoUriSamples.java new file mode 100644 index 000000000000..651c32d2ef3b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGenerateSsoUriSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles GenerateSsoUri. + */ +public final class ProfilesGenerateSsoUriSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_GenerateSsoUri.json + */ + /** + * Sample code: Profiles_GenerateSsoUri. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesGenerateSsoUri(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().generateSsoUriWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGetByResourceGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..826611aaa6be --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles GetByResourceGroup. + */ +public final class ProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Get.json + */ + /** + * Sample code: Profiles_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().getByResourceGroupWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListByResourceGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListByResourceGroupSamples.java new file mode 100644 index 000000000000..06f9ad1b672c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles ListByResourceGroup. + */ +public final class ProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_ListByResourceGroup.json + */ + /** + * Sample code: Profiles_ListByResourceGroup. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListByResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listByResourceGroup("RG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListResourceUsageSamples.java new file mode 100644 index 000000000000..d1fa3cd180a8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListResourceUsageSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles ListResourceUsage. + */ +public final class ProfilesListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_ListResourceUsage.json + */ + /** + * Sample code: Profiles_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listResourceUsage("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSamples.java new file mode 100644 index 000000000000..adfed759b910 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles List. + */ +public final class ProfilesListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_List.json + */ + /** + * Sample code: Profiles_List. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSupportedOptimizationTypesSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSupportedOptimizationTypesSamples.java new file mode 100644 index 000000000000..1f193c5cce21 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSupportedOptimizationTypesSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles ListSupportedOptimizationTypes. + */ +public final class ProfilesListSupportedOptimizationTypesSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ + * Profiles_ListSupportedOptimizationTypes.json + */ + /** + * Sample code: Profiles_ListSupportedOptimizationTypes. + * + * @param manager Entry point to CdnManager. + */ + public static void + profilesListSupportedOptimizationTypes(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .listSupportedOptimizationTypesWithResponse("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrateSamples.java new file mode 100644 index 000000000000..bab2934e0105 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrateSamples.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.generated; + +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** + * Samples for Profiles Migrate. + */ +public final class ProfilesMigrateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Migrate.json + */ + /** + * Sample code: Profiles_Migrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles() + .migrate("RG", + new MigrationParameters().withSku(new Sku().withName(SkuName.STANDARD_AZURE_FRONT_DOOR)) + .withClassicResourceReference(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname")) + .withProfileName("profile1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationAbortSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationAbortSamples.java new file mode 100644 index 000000000000..b69b55e41cfb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationAbortSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles MigrationAbort. + */ +public final class ProfilesMigrationAbortSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_MigrationAbort.json + */ + /** + * Sample code: Profiles_CdnMigrationCommit. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCdnMigrationCommit(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().migrationAbort("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationCommitSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationCommitSamples.java new file mode 100644 index 000000000000..1c14e4bac16b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationCommitSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Profiles MigrationCommit. + */ +public final class ProfilesMigrationCommitSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_MigrationCommit.json + */ + /** + * Sample code: Profiles_MigrationCommit. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesMigrationCommit(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().migrationCommit("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesUpdateSamples.java new file mode 100644 index 000000000000..f567ae2ce48b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesUpdateSamples.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.generated; + +import com.azure.resourcemanager.cdn.generated.models.Profile; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Profiles Update. + */ +public final class ProfilesUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Profiles_Update.json + */ + /** + * Sample code: Profiles_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Profile resource = manager.profiles() + .getByResourceGroupWithResponse("RG", "profile1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "Tag1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckEndpointNameAvailabilitySamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckEndpointNameAvailabilitySamples.java new file mode 100644 index 000000000000..c971884dbc31 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckEndpointNameAvailabilitySamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** + * Samples for ResourceProvider CheckEndpointNameAvailability. + */ +public final class ResourceProviderCheckEndpointNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CheckEndpointNameAvailability.json + */ + /** + * Sample code: CheckEndpointNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkEndpointNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceProviders() + .checkEndpointNameAvailabilityWithResponse("myResourceGroup", + new CheckEndpointNameAvailabilityInput().withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_AFD_ENDPOINTS) + .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilitySamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..fced58faa7c9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilitySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** + * Samples for ResourceProvider CheckNameAvailability. + */ +public final class ResourceProviderCheckNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CheckNameAvailability.json + */ + /** + * Sample code: CheckNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceProviders() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_ENDPOINTS), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilityWithSubscriptionSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilityWithSubscriptionSamples.java new file mode 100644 index 000000000000..c0023f101d7f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilityWithSubscriptionSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** + * Samples for ResourceProvider CheckNameAvailabilityWithSubscription. + */ +public final class ResourceProviderCheckNameAvailabilityWithSubscriptionSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/CheckNameAvailabilityWithSubscription + * .json + */ + /** + * Sample code: CheckNameAvailabilityWithSubscription. + * + * @param manager Entry point to CdnManager. + */ + public static void + checkNameAvailabilityWithSubscription(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceProviders() + .checkNameAvailabilityWithSubscriptionWithResponse(new CheckNameAvailabilityInput().withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_ENDPOINTS), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderValidateProbeSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderValidateProbeSamples.java new file mode 100644 index 000000000000..5f54234792df --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderValidateProbeSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; + +/** + * Samples for ResourceProvider ValidateProbe. + */ +public final class ResourceProviderValidateProbeSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ValidateProbe.json + */ + /** + * Sample code: ValidateProbe. + * + * @param manager Entry point to CdnManager. + */ + public static void validateProbe(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceProviders() + .validateProbeWithResponse(new ValidateProbeInput().withProbeUrl("https://www.bing.com/image"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceUsageListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceUsageListSamples.java new file mode 100644 index 000000000000..759b0bb7c7fd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceUsageListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for ResourceUsage List. + */ +public final class ResourceUsageListSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/ResourceUsage_List.json + */ + /** + * Sample code: ResourceUsage_List. + * + * @param manager Entry point to CdnManager. + */ + public static void resourceUsageList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceUsages().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesCreateSamples.java new file mode 100644 index 000000000000..3144e9ac7c94 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesCreateSamples.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.generated; + +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.CompressionSettings; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** + * Samples for Routes Create. + */ +public final class RoutesCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_Create.json + */ + /** + * Sample code: Routes_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void routesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes() + .define("route1") + .withExistingAfdEndpoint("RG", "profile1", "endpoint1") + .withCustomDomains(Arrays.asList(new ActivatedResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"))) + .withOriginGroup(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1")) + .withRuleSets(Arrays.asList(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"))) + .withSupportedProtocols(Arrays.asList(AfdEndpointProtocols.HTTPS, AfdEndpointProtocols.HTTP)) + .withPatternsToMatch(Arrays.asList("/*")) + .withCacheConfiguration(new AfdRouteCacheConfiguration() + .withQueryStringCachingBehavior(AfdQueryStringCachingBehavior.IGNORE_SPECIFIED_QUERY_STRINGS) + .withQueryParameters("querystring=test") + .withCompressionSettings(new CompressionSettings() + .withContentTypesToCompress(Arrays.asList("text/html", "application/octet-stream")) + .withIsCompressionEnabled(true))) + .withForwardingProtocol(ForwardingProtocol.MATCH_REQUEST) + .withLinkToDefaultDomain(LinkToDefaultDomain.ENABLED) + .withHttpsRedirect(HttpsRedirect.ENABLED) + .withEnabledState(EnabledState.ENABLED) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesDeleteSamples.java new file mode 100644 index 000000000000..955860b1b1ab --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Routes Delete. + */ +public final class RoutesDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_Delete.json + */ + /** + * Sample code: Routes_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void routesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().delete("RG", "profile1", "endpoint1", "route1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesGetSamples.java new file mode 100644 index 000000000000..8b9678905e59 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Routes Get. + */ +public final class RoutesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_Get.json + */ + /** + * Sample code: Routes_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void routesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().getWithResponse("RG", "profile1", "endpoint1", "route1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesListByEndpointSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesListByEndpointSamples.java new file mode 100644 index 000000000000..0e206d76db47 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesListByEndpointSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Routes ListByEndpoint. + */ +public final class RoutesListByEndpointSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_ListByEndpoint.json + */ + /** + * Sample code: Routes_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void routesListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().listByEndpoint("RG", "profile1", "endpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesUpdateSamples.java new file mode 100644 index 000000000000..9d0c0dbe864b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesUpdateSamples.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.generated; + +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.CompressionSettings; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Route; +import java.util.Arrays; + +/** + * Samples for Routes Update. + */ +public final class RoutesUpdateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Routes_Update.json + */ + /** + * Sample code: Routes_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void routesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Route resource = manager.routes() + .getWithResponse("RG", "profile1", "endpoint1", "route1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withCustomDomains(Arrays.asList(new ActivatedResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"))) + .withOriginGroup(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1")) + .withRuleSets(Arrays.asList(new ResourceReference().withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"))) + .withSupportedProtocols(Arrays.asList(AfdEndpointProtocols.HTTPS, AfdEndpointProtocols.HTTP)) + .withPatternsToMatch(Arrays.asList("/*")) + .withCacheConfiguration(new AfdRouteCacheConfiguration() + .withQueryStringCachingBehavior(AfdQueryStringCachingBehavior.IGNORE_QUERY_STRING) + .withCompressionSettings(new CompressionSettings() + .withContentTypesToCompress(Arrays.asList("text/html", "application/octet-stream")) + .withIsCompressionEnabled(true))) + .withForwardingProtocol(ForwardingProtocol.MATCH_REQUEST) + .withLinkToDefaultDomain(LinkToDefaultDomain.ENABLED) + .withHttpsRedirect(HttpsRedirect.ENABLED) + .withEnabledState(EnabledState.ENABLED) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsCreateSamples.java new file mode 100644 index 000000000000..1676b8b30410 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsCreateSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for RuleSets Create. + */ +public final class RuleSetsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_Create.json + */ + /** + * Sample code: RuleSets_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().createWithResponse("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsDeleteSamples.java new file mode 100644 index 000000000000..684cdde029c2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for RuleSets Delete. + */ +public final class RuleSetsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_Delete.json + */ + /** + * Sample code: RuleSets_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().delete("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsGetSamples.java new file mode 100644 index 000000000000..6a6726e15a29 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for RuleSets Get. + */ +public final class RuleSetsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_Get.json + */ + /** + * Sample code: RuleSets_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().getWithResponse("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListByProfileSamples.java new file mode 100644 index 000000000000..cbfa72d2dc31 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListByProfileSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for RuleSets ListByProfile. + */ +public final class RuleSetsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_ListByProfile.json + */ + /** + * Sample code: RuleSets_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListResourceUsageSamples.java new file mode 100644 index 000000000000..52bce7bc4be9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListResourceUsageSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for RuleSets ListResourceUsage. + */ +public final class RuleSetsListResourceUsageSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/RuleSets_ListResourceUsage.json + */ + /** + * Sample code: RuleSets_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().listResourceUsage("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesCreateSamples.java new file mode 100644 index 000000000000..574b88755015 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesCreateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleRequestMethodCondition; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleResponseHeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderActionParameters; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodMatchConditionParameters; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodMatchValue; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodOperator; +import java.util.Arrays; + +/** + * Samples for Rules Create. + */ +public final class RulesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_Create.json + */ + /** + * Sample code: Rules_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules() + .define("rule1") + .withExistingRuleSet("RG", "profile1", "ruleSet1") + .withOrder(1) + .withConditions(Arrays.asList(new DeliveryRuleRequestMethodCondition() + .withParameters(new RequestMethodMatchConditionParameters().withOperator(RequestMethodOperator.EQUAL) + .withNegateCondition(false) + .withMatchValues(Arrays.asList(RequestMethodMatchValue.GET))))) + .withActions(Arrays.asList(new DeliveryRuleResponseHeaderAction() + .withParameters(new HeaderActionParameters().withHeaderAction(HeaderAction.OVERWRITE) + .withHeaderName("X-CDN") + .withValue("MSFT")))) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesDeleteSamples.java new file mode 100644 index 000000000000..dacf240a2f34 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Rules Delete. + */ +public final class RulesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_Delete.json + */ + /** + * Sample code: Rules_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().delete("RG", "profile1", "ruleSet1", "rule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesGetSamples.java new file mode 100644 index 000000000000..d3ef31c41d62 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Rules Get. + */ +public final class RulesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_Get.json + */ + /** + * Sample code: Rules_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().getWithResponse("RG", "profile1", "ruleSet1", "rule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesListByRuleSetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesListByRuleSetSamples.java new file mode 100644 index 000000000000..e1bcf7d1fefa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesListByRuleSetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Rules ListByRuleSet. + */ +public final class RulesListByRuleSetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_ListByRuleSet.json + */ + /** + * Sample code: Rules_ListByRuleSet. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesListByRuleSet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().listByRuleSet("RG", "profile1", "ruleSet1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesUpdateSamples.java new file mode 100644 index 000000000000..1422871202ee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleResponseHeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderActionParameters; +import com.azure.resourcemanager.cdn.generated.models.Rule; +import java.util.Arrays; + +/** + * Samples for Rules Update. + */ +public final class RulesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Rules_Update.json + */ + /** + * Sample code: Rules_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Rule resource = manager.rules() + .getWithResponse("RG", "profile1", "ruleSet1", "rule1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withOrder(1) + .withActions(Arrays.asList(new DeliveryRuleResponseHeaderAction() + .withParameters(new HeaderActionParameters().withHeaderAction(HeaderAction.OVERWRITE) + .withHeaderName("X-CDN") + .withValue("MSFT")))) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsCreateSamples.java new file mode 100644 index 000000000000..84f96fc4e711 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsCreateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.CustomerCertificateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** + * Samples for Secrets Create. + */ +public final class SecretsCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Secrets_Create.json + */ + /** + * Sample code: Secrets_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets() + .define("secret1") + .withExistingProfile("RG", "profile1") + .withParameters(new CustomerCertificateParameters().withSecretSource(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/secrets/certificatename")) + .withSecretVersion("fakeTokenPlaceholder") + .withUseLatestVersion(false)) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsDeleteSamples.java new file mode 100644 index 000000000000..22dabacd1de6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Secrets Delete. + */ +public final class SecretsDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Secrets_Delete.json + */ + /** + * Sample code: Secrets_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().delete("RG", "profile1", "secret1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsGetSamples.java new file mode 100644 index 000000000000..6b29127ddfbf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Secrets Get. + */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Secrets_Get.json + */ + /** + * Sample code: Secrets_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().getWithResponse("RG", "profile1", "secret1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsListByProfileSamples.java new file mode 100644 index 000000000000..8e7968705a32 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsListByProfileSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for Secrets ListByProfile. + */ +public final class SecretsListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/Secrets_ListByProfile.json + */ + /** + * Sample code: Secrets_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesCreateSamples.java new file mode 100644 index 000000000000..9c4de694e2b7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesCreateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallAssociation; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallParameters; +import java.util.Arrays; + +/** + * Samples for SecurityPolicies Create. + */ +public final class SecurityPoliciesCreateSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_Create.json + */ + /** + * Sample code: SecurityPolicies_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies() + .define("securityPolicy1") + .withExistingProfile("RG", "profile1") + .withParameters(new SecurityPolicyWebApplicationFirewallParameters() + .withWafPolicy(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest")) + .withAssociations(Arrays.asList(new SecurityPolicyWebApplicationFirewallAssociation() + .withDomains(Arrays.asList(new ActivatedResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), + new ActivatedResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"))) + .withPatternsToMatch(Arrays.asList("/*"))))) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesDeleteSamples.java new file mode 100644 index 000000000000..6f2920a2a468 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for SecurityPolicies Delete. + */ +public final class SecurityPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_Delete.json + */ + /** + * Sample code: SecurityPolicies_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().delete("RG", "profile1", "securityPolicy1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesGetSamples.java new file mode 100644 index 000000000000..d52f710c5103 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesGetSamples.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.generated; + +/** + * Samples for SecurityPolicies Get. + */ +public final class SecurityPoliciesGetSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_Get.json + */ + /** + * Sample code: SecurityPolicies_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies() + .getWithResponse("RG", "profile1", "securityPolicy1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesListByProfileSamples.java new file mode 100644 index 000000000000..ca49ac271358 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesListByProfileSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** + * Samples for SecurityPolicies ListByProfile. + */ +public final class SecurityPoliciesListByProfileSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_ListByProfile.json + */ + /** + * Sample code: SecurityPolicies_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().listByProfile("RG", "profile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesPatchSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesPatchSamples.java new file mode 100644 index 000000000000..02463b93aed8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesPatchSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicy; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallAssociation; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallParameters; +import java.util.Arrays; + +/** + * Samples for SecurityPolicies Patch. + */ +public final class SecurityPoliciesPatchSamples { + /* + * x-ms-original-file: + * specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-09-01/examples/SecurityPolicies_Patch.json + */ + /** + * Sample code: SecurityPolicies_Patch. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesPatch(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + SecurityPolicy resource = manager.securityPolicies() + .getWithResponse("RG", "profile1", "securityPolicy1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withParameters(new SecurityPolicyWebApplicationFirewallParameters() + .withWafPolicy(new ResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest")) + .withAssociations(Arrays.asList(new SecurityPolicyWebApplicationFirewallAssociation() + .withDomains(Arrays.asList(new ActivatedResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), + new ActivatedResourceReference().withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"))) + .withPatternsToMatch(Arrays.asList("/*"))))) + .apply(); + } +} diff --git a/sdk/cdn/ci.yml b/sdk/cdn/ci.yml new file mode 100644 index 000000000000..c17c28e1e6e4 --- /dev/null +++ b/sdk/cdn/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.yml + - sdk/cdn/azure-resourcemanager-cdn-generated/ + exclude: + - sdk/cdn/pom.xml + - sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.yml + - sdk/cdn/azure-resourcemanager-cdn-generated/ + exclude: + - sdk/cdn/pom.xml + - sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml + +parameters: + - name: release_azureresourcemanagercdngenerated + displayName: azure-resourcemanager-cdn-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: cdn + Artifacts: + - name: azure-resourcemanager-cdn-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercdngenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagercdngenerated }} diff --git a/sdk/cdn/pom.xml b/sdk/cdn/pom.xml new file mode 100644 index 000000000000..ebddcd708d5e --- /dev/null +++ b/sdk/cdn/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-cdn-service + pom + 1.0.0 + + + azure-resourcemanager-cdn-generated + +