From b415b4bdff3ed5d7389fe8425c8e800ac6fa7191 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 8 Apr 2021 21:43:35 -0700 Subject: [PATCH] [Automation] Generate Fluent Lite from frontdoor# (#20491) * [Automation] External Change * [Automation] Generate Fluent Lite from frontdoor# --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../azure-resourcemanager-frontdoor/README.md | 99 ++ .../azure-resourcemanager-frontdoor/pom.xml | 67 + .../frontdoor/FrontDoorManager.java | 352 ++++ .../frontdoor/fluent/EndpointsClient.java | 82 + .../frontdoor/fluent/ExperimentsClient.java | 280 +++ .../fluent/FrontDoorManagementClient.java | 124 ++ .../FrontDoorNameAvailabilitiesClient.java | 41 + ...meAvailabilityWithSubscriptionsClient.java | 44 + .../frontdoor/fluent/FrontDoorsClient.java | 245 +++ .../fluent/FrontendEndpointsClient.java | 212 +++ .../fluent/ManagedRuleSetsClient.java | 36 + .../NetworkExperimentProfilesClient.java | 265 +++ .../frontdoor/fluent/PoliciesClient.java | 184 ++ .../fluent/PreconfiguredEndpointsClient.java | 41 + .../frontdoor/fluent/ReportsClient.java | 121 ++ .../frontdoor/fluent/RulesEnginesClient.java | 214 +++ .../CheckNameAvailabilityOutputInner.java | 70 + .../fluent/models/ExperimentInner.java | 200 +++ .../fluent/models/FrontDoorInner.java | 360 ++++ .../fluent/models/FrontendEndpointInner.java | 264 +++ .../fluent/models/LatencyScorecardInner.java | 197 +++ .../models/ManagedRuleSetDefinitionInner.java | 122 ++ .../models/PreconfiguredEndpointInner.java | 147 ++ .../frontdoor/fluent/models/ProfileInner.java | 112 ++ .../fluent/models/RulesEngineInner.java | 77 + .../fluent/models/TimeseriesInner.java | 234 +++ .../ValidateCustomDomainOutputInner.java | 69 + .../WebApplicationFirewallPolicyInner.java | 286 +++ .../frontdoor/fluent/models/package-info.java | 6 + .../frontdoor/fluent/package-info.java | 6 + .../CheckNameAvailabilityOutputImpl.java | 42 + .../implementation/EndpointsClientImpl.java | 361 ++++ .../implementation/EndpointsImpl.java | 43 + .../implementation/ExperimentImpl.java | 234 +++ .../implementation/ExperimentsClientImpl.java | 1439 ++++++++++++++++ .../implementation/ExperimentsImpl.java | 201 +++ .../implementation/FrontDoorImpl.java | 301 ++++ .../FrontDoorManagementClientBuilder.java | 149 ++ .../FrontDoorManagementClientImpl.java | 440 +++++ ...FrontDoorNameAvailabilitiesClientImpl.java | 199 +++ .../FrontDoorNameAvailabilitiesImpl.java | 63 + ...ailabilityWithSubscriptionsClientImpl.java | 226 +++ ...NameAvailabilityWithSubscriptionsImpl.java | 65 + .../implementation/FrontDoorsClientImpl.java | 1457 ++++++++++++++++ .../implementation/FrontDoorsImpl.java | 204 +++ .../implementation/FrontendEndpointImpl.java | 78 + .../FrontendEndpointsClientImpl.java | 1149 +++++++++++++ .../implementation/FrontendEndpointsImpl.java | 106 ++ .../implementation/LatencyScorecardImpl.java | 99 ++ .../ManagedRuleSetDefinitionImpl.java | 83 + .../ManagedRuleSetsClientImpl.java | 289 ++++ .../implementation/ManagedRuleSetsImpl.java | 46 + .../NetworkExperimentProfilesClientImpl.java | 1527 +++++++++++++++++ .../NetworkExperimentProfilesImpl.java | 183 ++ .../implementation/PoliciesClientImpl.java | 1035 +++++++++++ .../implementation/PoliciesImpl.java | 179 ++ .../PreconfiguredEndpointImpl.java | 72 + .../PreconfiguredEndpointsClientImpl.java | 340 ++++ .../PreconfiguredEndpointsImpl.java | 47 + .../frontdoor/implementation/ProfileImpl.java | 198 +++ .../implementation/ReportsClientImpl.java | 719 ++++++++ .../frontdoor/implementation/ReportsImpl.java | 150 ++ .../implementation/RulesEngineImpl.java | 143 ++ .../RulesEnginesClientImpl.java | 1167 +++++++++++++ .../implementation/RulesEnginesImpl.java | 189 ++ .../implementation/TimeseriesImpl.java | 91 + .../frontdoor/implementation/Utils.java | 204 +++ .../ValidateCustomDomainOutputImpl.java | 41 + .../WebApplicationFirewallPolicyImpl.java | 250 +++ .../implementation/package-info.java | 6 + .../frontdoor/models/ActionType.java | 40 + .../frontdoor/models/AggregationInterval.java | 34 + .../frontdoor/models/Availability.java | 34 + .../frontdoor/models/Backend.java | 346 ++++ .../frontdoor/models/BackendEnabledState.java | 34 + .../frontdoor/models/BackendPool.java | 172 ++ .../models/BackendPoolProperties.java | 64 + .../models/BackendPoolUpdateParameters.java | 107 ++ .../models/BackendPoolsSettings.java | 83 + .../frontdoor/models/CacheConfiguration.java | 133 ++ .../models/CheckNameAvailabilityInput.java | 86 + .../models/CheckNameAvailabilityOutput.java | 38 + .../models/CustomHttpsConfiguration.java | 236 +++ .../models/CustomHttpsProvisioningState.java | 43 + .../CustomHttpsProvisioningSubstate.java | 63 + .../frontdoor/models/CustomRule.java | 256 +++ .../models/CustomRuleEnabledState.java | 34 + .../frontdoor/models/CustomRuleList.java | 54 + .../models/DynamicCompressionEnabled.java | 34 + .../frontdoor/models/Endpoint.java | 76 + .../frontdoor/models/EndpointType.java | 40 + .../frontdoor/models/Endpoints.java | 40 + ...forceCertificateNameCheckEnabledState.java | 35 + .../frontdoor/models/Error.java | 158 ++ .../frontdoor/models/ErrorDetails.java | 102 ++ .../frontdoor/models/Experiment.java | 307 ++++ .../frontdoor/models/ExperimentList.java | 73 + .../models/ExperimentUpdateModel.java | 105 ++ .../frontdoor/models/Experiments.java | 142 ++ .../models/ForwardingConfiguration.java | 143 ++ .../frontdoor/models/FrontDoor.java | 472 +++++ .../models/FrontDoorCertificateSource.java | 34 + .../models/FrontDoorCertificateType.java | 31 + .../models/FrontDoorEnabledState.java | 34 + .../models/FrontDoorForwardingProtocol.java | 37 + .../models/FrontDoorHealthProbeMethod.java | 34 + .../frontdoor/models/FrontDoorListResult.java | 73 + .../models/FrontDoorNameAvailabilities.java | 35 + ...DoorNameAvailabilityWithSubscriptions.java | 35 + .../frontdoor/models/FrontDoorProperties.java | 163 ++ .../frontdoor/models/FrontDoorProtocol.java | 34 + .../frontdoor/models/FrontDoorQuery.java | 40 + .../models/FrontDoorRedirectProtocol.java | 37 + .../models/FrontDoorRedirectType.java | 40 + .../models/FrontDoorResourceState.java | 46 + .../models/FrontDoorTlsProtocolType.java | 31 + .../models/FrontDoorUpdateParameters.java | 255 +++ .../frontdoor/models/FrontDoors.java | 187 ++ .../frontdoor/models/FrontendEndpoint.java | 98 ++ .../models/FrontendEndpointLink.java | 50 + .../models/FrontendEndpointProperties.java | 121 ++ .../FrontendEndpointUpdateParameters.java | 142 ++ ...etersWebApplicationFirewallPolicyLink.java | 52 + .../frontdoor/models/FrontendEndpoints.java | 126 ++ .../models/FrontendEndpointsListResult.java | 73 + .../frontdoor/models/HeaderAction.java | 115 ++ .../frontdoor/models/HeaderActionType.java | 37 + .../frontdoor/models/HealthProbeEnabled.java | 34 + .../models/HealthProbeSettingsModel.java | 229 +++ .../models/HealthProbeSettingsProperties.java | 76 + .../HealthProbeSettingsUpdateParameters.java | 163 ++ ...VaultCertificateSourceParametersVault.java | 50 + .../frontdoor/models/LatencyMetric.java | 174 ++ .../frontdoor/models/LatencyScorecard.java | 119 ++ .../LatencyScorecardAggregationInterval.java | 38 + .../models/LoadBalancingSettingsModel.java | 171 ++ .../LoadBalancingSettingsProperties.java | 62 + ...LoadBalancingSettingsUpdateParameters.java | 106 ++ .../models/ManagedRuleDefinition.java | 85 + .../models/ManagedRuleEnabledState.java | 34 + .../models/ManagedRuleExclusion.java | 124 ++ .../ManagedRuleExclusionMatchVariable.java | 45 + ...gedRuleExclusionSelectorMatchOperator.java | 44 + .../models/ManagedRuleGroupDefinition.java | 73 + .../models/ManagedRuleGroupOverride.java | 118 ++ .../frontdoor/models/ManagedRuleOverride.java | 140 ++ .../frontdoor/models/ManagedRuleSet.java | 172 ++ .../models/ManagedRuleSetActionType.java | 37 + .../models/ManagedRuleSetDefinition.java | 89 + .../models/ManagedRuleSetDefinitionList.java | 70 + .../frontdoor/models/ManagedRuleSetList.java | 54 + .../frontdoor/models/ManagedRuleSets.java | 31 + .../frontdoor/models/MatchCondition.java | 199 +++ .../models/MatchProcessingBehavior.java | 34 + .../frontdoor/models/MatchVariable.java | 55 + .../frontdoor/models/MinimumTlsVersion.java | 34 + .../models/NetworkExperimentProfiles.java | 155 ++ .../NetworkExperimentResourceState.java | 46 + .../models/NetworkOperationStatus.java | 37 + .../frontdoor/models/Operator.java | 64 + .../frontdoor/models/Policies.java | 136 ++ .../frontdoor/models/PolicyEnabledState.java | 34 + .../frontdoor/models/PolicyMode.java | 34 + .../models/PolicyRequestBodyCheck.java | 34 + .../frontdoor/models/PolicyResourceState.java | 46 + .../frontdoor/models/PolicySettings.java | 190 ++ .../models/PreconfiguredEndpoint.java | 81 + .../models/PreconfiguredEndpointList.java | 70 + .../models/PreconfiguredEndpoints.java | 36 + .../models/PrivateEndpointStatus.java | 43 + .../frontdoor/models/Profile.java | 245 +++ .../frontdoor/models/ProfileList.java | 70 + .../frontdoor/models/ProfileUpdateModel.java | 79 + .../frontdoor/models/PurgeParameters.java | 59 + .../models/RedirectConfiguration.java | 205 +++ .../frontdoor/models/Reports.java | 110 ++ .../frontdoor/models/ResourceType.java | 47 + .../frontdoor/models/RouteConfiguration.java | 42 + .../frontdoor/models/RoutingRule.java | 288 ++++ .../models/RoutingRuleEnabledState.java | 34 + .../frontdoor/models/RoutingRuleLink.java | 50 + .../models/RoutingRuleProperties.java | 93 + .../models/RoutingRuleUpdateParameters.java | 220 +++ ...etersWebApplicationFirewallPolicyLink.java | 52 + .../frontdoor/models/RuleType.java | 34 + .../frontdoor/models/RulesEngine.java | 157 ++ .../frontdoor/models/RulesEngineAction.java | 116 ++ .../models/RulesEngineListResult.java | 73 + .../models/RulesEngineMatchCondition.java | 205 +++ .../models/RulesEngineMatchVariable.java | 64 + .../frontdoor/models/RulesEngineOperator.java | 61 + .../models/RulesEngineProperties.java | 49 + .../frontdoor/models/RulesEngineRule.java | 182 ++ .../models/RulesEngineUpdateParameters.java | 54 + .../frontdoor/models/RulesEngines.java | 142 ++ .../frontdoor/models/SecurityPolicyLink.java | 50 + .../models/SessionAffinityEnabledState.java | 34 + .../resourcemanager/frontdoor/models/Sku.java | 50 + .../frontdoor/models/SkuName.java | 37 + .../frontdoor/models/State.java | 34 + .../frontdoor/models/Timeseries.java | 104 ++ .../models/TimeseriesAggregationInterval.java | 34 + .../frontdoor/models/TimeseriesDataPoint.java | 76 + .../frontdoor/models/TimeseriesType.java | 40 + .../frontdoor/models/Transform.java | 46 + .../frontdoor/models/TransformType.java | 46 + .../models/ValidateCustomDomainInput.java | 56 + .../models/ValidateCustomDomainOutput.java | 38 + .../models/WebApplicationFirewallPolicy.java | 384 +++++ .../WebApplicationFirewallPolicyList.java | 74 + .../frontdoor/models/package-info.java | 6 + .../frontdoor/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/frontdoor/ci.yml | 33 + sdk/frontdoor/pom.xml | 53 + 218 files changed, 31540 insertions(+) create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/CHANGELOG.md create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/README.md create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/pom.xml create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/FrontDoorManager.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/EndpointsClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ExperimentsClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorManagementClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorNameAvailabilitiesClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorNameAvailabilityWithSubscriptionsClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorsClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontendEndpointsClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ManagedRuleSetsClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/NetworkExperimentProfilesClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/PoliciesClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/PreconfiguredEndpointsClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ReportsClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/RulesEnginesClient.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/CheckNameAvailabilityOutputInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ExperimentInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/FrontDoorInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/FrontendEndpointInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/LatencyScorecardInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ManagedRuleSetDefinitionInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/PreconfiguredEndpointInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ProfileInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/RulesEngineInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/TimeseriesInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ValidateCustomDomainOutputInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/WebApplicationFirewallPolicyInner.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/package-info.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/package-info.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/CheckNameAvailabilityOutputImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/EndpointsClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/EndpointsImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentsClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentsImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorManagementClientBuilder.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorManagementClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilitiesClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilitiesImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilityWithSubscriptionsClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilityWithSubscriptionsImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorsClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorsImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointsClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointsImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/LatencyScorecardImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetDefinitionImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetsClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetsImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/NetworkExperimentProfilesClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/NetworkExperimentProfilesImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PoliciesClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PoliciesImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointsClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointsImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ProfileImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ReportsClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ReportsImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEngineImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEnginesClientImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEnginesImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/TimeseriesImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/Utils.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ValidateCustomDomainOutputImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/WebApplicationFirewallPolicyImpl.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/package-info.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ActionType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/AggregationInterval.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Availability.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Backend.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendEnabledState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPool.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolProperties.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolUpdateParameters.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolsSettings.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CacheConfiguration.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CheckNameAvailabilityInput.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CheckNameAvailabilityOutput.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsConfiguration.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsProvisioningState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsProvisioningSubstate.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRule.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRuleEnabledState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRuleList.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/DynamicCompressionEnabled.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Endpoint.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/EndpointType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Endpoints.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/EnforceCertificateNameCheckEnabledState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Error.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ErrorDetails.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Experiment.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ExperimentList.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ExperimentUpdateModel.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Experiments.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ForwardingConfiguration.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoor.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorCertificateSource.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorCertificateType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorEnabledState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorForwardingProtocol.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorHealthProbeMethod.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorListResult.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorNameAvailabilities.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorNameAvailabilityWithSubscriptions.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorProperties.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorProtocol.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorQuery.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorRedirectProtocol.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorRedirectType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorResourceState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorTlsProtocolType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorUpdateParameters.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoors.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpoint.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointLink.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointProperties.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointUpdateParameters.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpoints.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointsListResult.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HeaderAction.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HeaderActionType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeEnabled.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsModel.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsProperties.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsUpdateParameters.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/KeyVaultCertificateSourceParametersVault.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyMetric.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyScorecard.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyScorecardAggregationInterval.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsModel.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsProperties.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsUpdateParameters.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleDefinition.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleEnabledState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusion.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusionMatchVariable.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusionSelectorMatchOperator.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleGroupDefinition.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleGroupOverride.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleOverride.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSet.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetActionType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetDefinition.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetDefinitionList.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetList.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSets.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchCondition.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchProcessingBehavior.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchVariable.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MinimumTlsVersion.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkExperimentProfiles.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkExperimentResourceState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkOperationStatus.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Operator.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Policies.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyEnabledState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyMode.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyRequestBodyCheck.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyResourceState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicySettings.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpoint.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpointList.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpoints.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PrivateEndpointStatus.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Profile.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ProfileList.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ProfileUpdateModel.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PurgeParameters.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RedirectConfiguration.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Reports.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ResourceType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RouteConfiguration.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRule.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleEnabledState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleLink.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleProperties.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleUpdateParameters.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RuleType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngine.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineAction.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineListResult.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineMatchCondition.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineMatchVariable.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineOperator.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineProperties.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineRule.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineUpdateParameters.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngines.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SecurityPolicyLink.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SessionAffinityEnabledState.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Sku.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SkuName.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/State.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Timeseries.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesAggregationInterval.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesDataPoint.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Transform.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TransformType.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ValidateCustomDomainInput.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ValidateCustomDomainOutput.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/WebApplicationFirewallPolicy.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/WebApplicationFirewallPolicyList.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/package-info.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/package-info.java create mode 100644 sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/module-info.java create mode 100644 sdk/frontdoor/ci.yml create mode 100644 sdk/frontdoor/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 7f86782f6548f..5b128d95f3f49 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -226,6 +226,7 @@ com.azure.resourcemanager:azure-resourcemanager-synapse;1.0.0-beta.1;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-resourcehealth;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-databricks;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-databoxedge;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-frontdoor;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index d19c881b3df22..5f36d3003ca9a 100644 --- a/pom.xml +++ b/pom.xml @@ -680,6 +680,7 @@ sdk/eventgrid sdk/eventhubs sdk/formrecognizer + sdk/frontdoor sdk/hdinsight sdk/healthbot sdk/hybridkubernetes diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/CHANGELOG.md b/sdk/frontdoor/azure-resourcemanager-frontdoor/CHANGELOG.md new file mode 100644 index 0000000000000..9aca0f2e16cbb --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-04-09) + +- Azure Resource Manager FrontDoor client library for Java. This package contains Microsoft Azure SDK for FrontDoor Management SDK. FrontDoor Client. Package tag package-2020-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/README.md b/sdk/frontdoor/azure-resourcemanager-frontdoor/README.md new file mode 100644 index 0000000000000..20ff1ffd42b28 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager FrontDoor client library for Java + +Azure Resource Manager FrontDoor client library for Java. + +This package contains Microsoft Azure SDK for FrontDoor Management SDK. FrontDoor Client. Package tag package-2020-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-frontdoor;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-frontdoor + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +FrontDoorManager manager = FrontDoorManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/pom.xml b/sdk/frontdoor/azure-resourcemanager-frontdoor/pom.xml new file mode 100644 index 0000000000000..644fed87d7dd5 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/pom.xml @@ -0,0 +1,67 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-frontdoor + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for FrontDoor Management + This package contains Microsoft Azure SDK for FrontDoor Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. FrontDoor Client. Package tag package-2020-11. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.15.0 + + + com.azure + azure-core-management + 1.2.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/FrontDoorManager.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/FrontDoorManager.java new file mode 100644 index 0000000000000..5d76eb3f98e70 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/FrontDoorManager.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.FrontDoorManagementClient; +import com.azure.resourcemanager.frontdoor.implementation.EndpointsImpl; +import com.azure.resourcemanager.frontdoor.implementation.ExperimentsImpl; +import com.azure.resourcemanager.frontdoor.implementation.FrontDoorManagementClientBuilder; +import com.azure.resourcemanager.frontdoor.implementation.FrontDoorNameAvailabilitiesImpl; +import com.azure.resourcemanager.frontdoor.implementation.FrontDoorNameAvailabilityWithSubscriptionsImpl; +import com.azure.resourcemanager.frontdoor.implementation.FrontDoorsImpl; +import com.azure.resourcemanager.frontdoor.implementation.FrontendEndpointsImpl; +import com.azure.resourcemanager.frontdoor.implementation.ManagedRuleSetsImpl; +import com.azure.resourcemanager.frontdoor.implementation.NetworkExperimentProfilesImpl; +import com.azure.resourcemanager.frontdoor.implementation.PoliciesImpl; +import com.azure.resourcemanager.frontdoor.implementation.PreconfiguredEndpointsImpl; +import com.azure.resourcemanager.frontdoor.implementation.ReportsImpl; +import com.azure.resourcemanager.frontdoor.implementation.RulesEnginesImpl; +import com.azure.resourcemanager.frontdoor.models.Endpoints; +import com.azure.resourcemanager.frontdoor.models.Experiments; +import com.azure.resourcemanager.frontdoor.models.FrontDoorNameAvailabilities; +import com.azure.resourcemanager.frontdoor.models.FrontDoorNameAvailabilityWithSubscriptions; +import com.azure.resourcemanager.frontdoor.models.FrontDoors; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpoints; +import com.azure.resourcemanager.frontdoor.models.ManagedRuleSets; +import com.azure.resourcemanager.frontdoor.models.NetworkExperimentProfiles; +import com.azure.resourcemanager.frontdoor.models.Policies; +import com.azure.resourcemanager.frontdoor.models.PreconfiguredEndpoints; +import com.azure.resourcemanager.frontdoor.models.Reports; +import com.azure.resourcemanager.frontdoor.models.RulesEngines; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to FrontDoorManager. FrontDoor Client. */ +public final class FrontDoorManager { + private NetworkExperimentProfiles networkExperimentProfiles; + + private PreconfiguredEndpoints preconfiguredEndpoints; + + private Experiments experiments; + + private Reports reports; + + private FrontDoorNameAvailabilities frontDoorNameAvailabilities; + + private FrontDoorNameAvailabilityWithSubscriptions frontDoorNameAvailabilityWithSubscriptions; + + private FrontDoors frontDoors; + + private FrontendEndpoints frontendEndpoints; + + private Endpoints endpoints; + + private RulesEngines rulesEngines; + + private Policies policies; + + private ManagedRuleSets managedRuleSets; + + private final FrontDoorManagementClient clientObject; + + private FrontDoorManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new FrontDoorManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of FrontDoor service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the FrontDoor service API instance. + */ + public static FrontDoorManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create FrontDoorManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new FrontDoorManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of FrontDoor service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the FrontDoor service API instance. + */ + public FrontDoorManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.frontdoor") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new FrontDoorManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of NetworkExperimentProfiles. */ + public NetworkExperimentProfiles networkExperimentProfiles() { + if (this.networkExperimentProfiles == null) { + this.networkExperimentProfiles = + new NetworkExperimentProfilesImpl(clientObject.getNetworkExperimentProfiles(), this); + } + return networkExperimentProfiles; + } + + /** @return Resource collection API of PreconfiguredEndpoints. */ + public PreconfiguredEndpoints preconfiguredEndpoints() { + if (this.preconfiguredEndpoints == null) { + this.preconfiguredEndpoints = + new PreconfiguredEndpointsImpl(clientObject.getPreconfiguredEndpoints(), this); + } + return preconfiguredEndpoints; + } + + /** @return Resource collection API of Experiments. */ + public Experiments experiments() { + if (this.experiments == null) { + this.experiments = new ExperimentsImpl(clientObject.getExperiments(), this); + } + return experiments; + } + + /** @return Resource collection API of Reports. */ + public Reports reports() { + if (this.reports == null) { + this.reports = new ReportsImpl(clientObject.getReports(), this); + } + return reports; + } + + /** @return Resource collection API of FrontDoorNameAvailabilities. */ + public FrontDoorNameAvailabilities frontDoorNameAvailabilities() { + if (this.frontDoorNameAvailabilities == null) { + this.frontDoorNameAvailabilities = + new FrontDoorNameAvailabilitiesImpl(clientObject.getFrontDoorNameAvailabilities(), this); + } + return frontDoorNameAvailabilities; + } + + /** @return Resource collection API of FrontDoorNameAvailabilityWithSubscriptions. */ + public FrontDoorNameAvailabilityWithSubscriptions frontDoorNameAvailabilityWithSubscriptions() { + if (this.frontDoorNameAvailabilityWithSubscriptions == null) { + this.frontDoorNameAvailabilityWithSubscriptions = + new FrontDoorNameAvailabilityWithSubscriptionsImpl( + clientObject.getFrontDoorNameAvailabilityWithSubscriptions(), this); + } + return frontDoorNameAvailabilityWithSubscriptions; + } + + /** @return Resource collection API of FrontDoors. */ + public FrontDoors frontDoors() { + if (this.frontDoors == null) { + this.frontDoors = new FrontDoorsImpl(clientObject.getFrontDoors(), this); + } + return frontDoors; + } + + /** @return Resource collection API of FrontendEndpoints. */ + public FrontendEndpoints frontendEndpoints() { + if (this.frontendEndpoints == null) { + this.frontendEndpoints = new FrontendEndpointsImpl(clientObject.getFrontendEndpoints(), this); + } + return frontendEndpoints; + } + + /** @return Resource collection API of Endpoints. */ + public Endpoints endpoints() { + if (this.endpoints == null) { + this.endpoints = new EndpointsImpl(clientObject.getEndpoints(), this); + } + return endpoints; + } + + /** @return Resource collection API of RulesEngines. */ + public RulesEngines rulesEngines() { + if (this.rulesEngines == null) { + this.rulesEngines = new RulesEnginesImpl(clientObject.getRulesEngines(), this); + } + return rulesEngines; + } + + /** @return Resource collection API of Policies. */ + public Policies policies() { + if (this.policies == null) { + this.policies = new PoliciesImpl(clientObject.getPolicies(), this); + } + return policies; + } + + /** @return Resource collection API of ManagedRuleSets. */ + public ManagedRuleSets managedRuleSets() { + if (this.managedRuleSets == null) { + this.managedRuleSets = new ManagedRuleSetsImpl(clientObject.getManagedRuleSets(), this); + } + return managedRuleSets; + } + + /** + * @return Wrapped service client FrontDoorManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public FrontDoorManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/EndpointsClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/EndpointsClient.java new file mode 100644 index 0000000000000..05c0cbf53b4ff --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/EndpointsClient.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.frontdoor.models.PurgeParameters; + +/** An instance of this class provides access to all the operations defined in EndpointsClient. */ +public interface EndpointsClient { + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurgeContent( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths); + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurgeContent( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths, Context context); + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @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 frontDoorName, PurgeParameters contentFilePaths); + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @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 frontDoorName, PurgeParameters contentFilePaths, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ExperimentsClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ExperimentsClient.java new file mode 100644 index 0000000000000..8391a2b0451aa --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ExperimentsClient.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.frontdoor.fluent.models.ExperimentInner; +import com.azure.resourcemanager.frontdoor.models.ExperimentUpdateModel; + +/** An instance of this class provides access to all the operations defined in ExperimentsClient. */ +public interface ExperimentsClient { + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of Experiments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of Experiments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an Experiment by ExperimentName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Experiment by ExperimentName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExperimentInner get(String resourceGroupName, String profileName, String experimentName); + + /** + * Gets an Experiment by ExperimentName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Experiment by ExperimentName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String experimentName, Context context); + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExperimentInner> beginCreateOrUpdate( + String resourceGroupName, String profileName, String experimentName, ExperimentInner parameters); + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExperimentInner> beginCreateOrUpdate( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentInner parameters, + Context context); + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExperimentInner createOrUpdate( + String resourceGroupName, String profileName, String experimentName, ExperimentInner parameters); + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExperimentInner createOrUpdate( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentInner parameters, + Context context); + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExperimentInner> beginUpdate( + String resourceGroupName, String profileName, String experimentName, ExperimentUpdateModel parameters); + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExperimentInner> beginUpdate( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentUpdateModel parameters, + Context context); + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExperimentInner update( + String resourceGroupName, String profileName, String experimentName, ExperimentUpdateModel parameters); + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExperimentInner update( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentUpdateModel parameters, + Context context); + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, String experimentName); + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String profileName, String experimentName, Context context); + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 experimentName); + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 experimentName, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorManagementClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorManagementClient.java new file mode 100644 index 0000000000000..10ac807c4e393 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorManagementClient.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.frontdoor.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for FrontDoorManagementClient class. */ +public interface FrontDoorManagementClient { + /** + * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * 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 NetworkExperimentProfilesClient object to access its operations. + * + * @return the NetworkExperimentProfilesClient object. + */ + NetworkExperimentProfilesClient getNetworkExperimentProfiles(); + + /** + * Gets the PreconfiguredEndpointsClient object to access its operations. + * + * @return the PreconfiguredEndpointsClient object. + */ + PreconfiguredEndpointsClient getPreconfiguredEndpoints(); + + /** + * Gets the ExperimentsClient object to access its operations. + * + * @return the ExperimentsClient object. + */ + ExperimentsClient getExperiments(); + + /** + * Gets the ReportsClient object to access its operations. + * + * @return the ReportsClient object. + */ + ReportsClient getReports(); + + /** + * Gets the FrontDoorNameAvailabilitiesClient object to access its operations. + * + * @return the FrontDoorNameAvailabilitiesClient object. + */ + FrontDoorNameAvailabilitiesClient getFrontDoorNameAvailabilities(); + + /** + * Gets the FrontDoorNameAvailabilityWithSubscriptionsClient object to access its operations. + * + * @return the FrontDoorNameAvailabilityWithSubscriptionsClient object. + */ + FrontDoorNameAvailabilityWithSubscriptionsClient getFrontDoorNameAvailabilityWithSubscriptions(); + + /** + * Gets the FrontDoorsClient object to access its operations. + * + * @return the FrontDoorsClient object. + */ + FrontDoorsClient getFrontDoors(); + + /** + * Gets the FrontendEndpointsClient object to access its operations. + * + * @return the FrontendEndpointsClient object. + */ + FrontendEndpointsClient getFrontendEndpoints(); + + /** + * Gets the EndpointsClient object to access its operations. + * + * @return the EndpointsClient object. + */ + EndpointsClient getEndpoints(); + + /** + * Gets the RulesEnginesClient object to access its operations. + * + * @return the RulesEnginesClient object. + */ + RulesEnginesClient getRulesEngines(); + + /** + * 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/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorNameAvailabilitiesClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorNameAvailabilitiesClient.java new file mode 100644 index 0000000000000..5b2f4692d2b14 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorNameAvailabilitiesClient.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.frontdoor.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.frontdoor.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityInput; + +/** An instance of this class provides access to all the operations defined in FrontDoorNameAvailabilitiesClient. */ +public interface FrontDoorNameAvailabilitiesClient { + /** + * Check the availability of a Front Door resource name. + * + * @param checkFrontDoorNameAvailabilityInput 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 check(CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput); + + /** + * Check the availability of a Front Door resource name. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkWithResponse( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorNameAvailabilityWithSubscriptionsClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorNameAvailabilityWithSubscriptionsClient.java new file mode 100644 index 0000000000000..21dd8e6e575d6 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorNameAvailabilityWithSubscriptionsClient.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.frontdoor.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.frontdoor.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityInput; + +/** + * An instance of this class provides access to all the operations defined in + * FrontDoorNameAvailabilityWithSubscriptionsClient. + */ +public interface FrontDoorNameAvailabilityWithSubscriptionsClient { + /** + * Check the availability of a Front Door subdomain. + * + * @param checkFrontDoorNameAvailabilityInput 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 check(CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput); + + /** + * Check the availability of a Front Door subdomain. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkWithResponse( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorsClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorsClient.java new file mode 100644 index 0000000000000..c79a9598d0863 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontDoorsClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.frontdoor.fluent.models.FrontDoorInner; +import com.azure.resourcemanager.frontdoor.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.frontdoor.models.ValidateCustomDomainInput; + +/** An instance of this class provides access to all the operations defined in FrontDoorsClient. */ +public interface FrontDoorsClient { + /** + * Lists all of the Front Doors 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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the Front Doors 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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Front Door with the specified Front Door name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FrontDoorInner getByResourceGroup(String resourceGroupName, String frontDoorName); + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Front Door with the specified Front Door name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String frontDoorName, Context context); + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FrontDoorInner> beginCreateOrUpdate( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters); + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FrontDoorInner> beginCreateOrUpdate( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters, Context context); + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FrontDoorInner createOrUpdate(String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters); + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FrontDoorInner createOrUpdate( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters, Context context); + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String frontDoorName); + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String frontDoorName, Context context); + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 frontDoorName); + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 frontDoorName, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @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 frontDoorName, ValidateCustomDomainInput customDomainProperties); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateCustomDomainWithResponse( + String resourceGroupName, + String frontDoorName, + ValidateCustomDomainInput customDomainProperties, + Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontendEndpointsClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontendEndpointsClient.java new file mode 100644 index 0000000000000..079fa48a35292 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/FrontendEndpointsClient.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.frontdoor.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.frontdoor.fluent.models.FrontendEndpointInner; +import com.azure.resourcemanager.frontdoor.models.CustomHttpsConfiguration; + +/** An instance of this class provides access to all the operations defined in FrontendEndpointsClient. */ +public interface FrontendEndpointsClient { + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName); + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFrontDoor( + String resourceGroupName, String frontDoorName, Context context); + + /** + * Gets a Frontend endpoint with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Frontend endpoint with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FrontendEndpointInner get(String resourceGroupName, String frontDoorName, String frontendEndpointName); + + /** + * Gets a Frontend endpoint with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Frontend endpoint with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context); + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginEnableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration); + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginEnableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration, + Context context); + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration); + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration, + Context context); + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDisableHttps( + String resourceGroupName, String frontDoorName, String frontendEndpointName); + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDisableHttps( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context); + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disableHttps(String resourceGroupName, String frontDoorName, String frontendEndpointName); + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disableHttps(String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ManagedRuleSetsClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ManagedRuleSetsClient.java new file mode 100644 index 0000000000000..81ff21ad60f44 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ManagedRuleSetsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.frontdoor.fluent.models.ManagedRuleSetDefinitionInner; + +/** An instance of this class provides access to all the operations defined in ManagedRuleSetsClient. */ +public interface ManagedRuleSetsClient { + /** + * Lists all available managed rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all available managed rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/NetworkExperimentProfilesClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/NetworkExperimentProfilesClient.java new file mode 100644 index 0000000000000..75f08e231cf14 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/NetworkExperimentProfilesClient.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.frontdoor.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.frontdoor.fluent.models.ProfileInner; +import com.azure.resourcemanager.frontdoor.models.ProfileUpdateModel; + +/** An instance of this class provides access to all the operations defined in NetworkExperimentProfilesClient. */ +public interface NetworkExperimentProfilesClient { + /** + * Gets a list of Network Experiment Profiles under a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Network Experiment Profiles under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of Network Experiment Profiles under a 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 a list of Network Experiment Profiles under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an NetworkExperiment Profile by ProfileName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner getByResourceGroup(String resourceGroupName, String profileName); + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an NetworkExperiment Profile by ProfileName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProfileInner> beginCreateOrUpdate( + String profileName, String resourceGroupName, ProfileInner parameters); + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProfileInner> beginCreateOrUpdate( + String profileName, String resourceGroupName, ProfileInner parameters, Context context); + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner createOrUpdate(String profileName, String resourceGroupName, ProfileInner parameters); + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner createOrUpdate(String profileName, String resourceGroupName, ProfileInner parameters, Context context); + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateModel parameters); + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateModel parameters, Context context); + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner update(String resourceGroupName, String profileName, ProfileUpdateModel parameters); + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner update(String resourceGroupName, String profileName, ProfileUpdateModel parameters, Context context); + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName); + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, Context context); + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/PoliciesClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/PoliciesClient.java new file mode 100644 index 0000000000000..c6575a5758a4e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/PoliciesClient.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.frontdoor.fluent.models.WebApplicationFirewallPolicyInner; + +/** 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. + */ + @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. + */ + @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 Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context); + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WebApplicationFirewallPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters); + + /** + * 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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WebApplicationFirewallPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, 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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters); + + /** + * 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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String policyName); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String policyName, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String policyName); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/PreconfiguredEndpointsClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/PreconfiguredEndpointsClient.java new file mode 100644 index 0000000000000..ab836afe47881 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/PreconfiguredEndpointsClient.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.frontdoor.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.frontdoor.fluent.models.PreconfiguredEndpointInner; + +/** An instance of this class provides access to all the operations defined in PreconfiguredEndpointsClient. */ +public interface PreconfiguredEndpointsClient { + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of Preconfigured Endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String profileName); + + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of Preconfigured Endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String profileName, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ReportsClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ReportsClient.java new file mode 100644 index 0000000000000..1bae85ea596d3 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ReportsClient.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.frontdoor.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.frontdoor.fluent.models.LatencyScorecardInner; +import com.azure.resourcemanager.frontdoor.fluent.models.TimeseriesInner; +import com.azure.resourcemanager.frontdoor.models.LatencyScorecardAggregationInterval; +import com.azure.resourcemanager.frontdoor.models.TimeseriesAggregationInterval; +import com.azure.resourcemanager.frontdoor.models.TimeseriesType; +import java.time.OffsetDateTime; + +/** An instance of this class provides access to all the operations defined in ReportsClient. */ +public interface ReportsClient { + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Latency Scorecard for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LatencyScorecardInner getLatencyScorecards( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval); + + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @param endDateTimeUtc The end DateTime of the Latency Scorecard in UTC. + * @param country The country associated with the Latency Scorecard. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Latency Scorecard for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLatencyScorecardsWithResponse( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval, + String endDateTimeUtc, + String country, + Context context); + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Timeseries for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TimeseriesInner getTimeseries( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType); + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @param endpoint The specific endpoint. + * @param country The country associated with the Timeseries. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Timeseries for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getTimeseriesWithResponse( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType, + String endpoint, + String country, + Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/RulesEnginesClient.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/RulesEnginesClient.java new file mode 100644 index 0000000000000..f4b67159ce8ec --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/RulesEnginesClient.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.frontdoor.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.frontdoor.fluent.models.RulesEngineInner; + +/** An instance of this class provides access to all the operations defined in RulesEnginesClient. */ +public interface RulesEnginesClient { + /** + * Lists all of the Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName); + + /** + * Lists all of the Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName, Context context); + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Rules Engine Configuration with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RulesEngineInner get(String resourceGroupName, String frontDoorName, String rulesEngineName); + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Rules Engine Configuration with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String frontDoorName, String rulesEngineName, Context context); + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RulesEngineInner> beginCreateOrUpdate( + String resourceGroupName, String frontDoorName, String rulesEngineName, RulesEngineInner rulesEngineParameters); + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RulesEngineInner> beginCreateOrUpdate( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters, + Context context); + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RulesEngineInner createOrUpdate( + String resourceGroupName, String frontDoorName, String rulesEngineName, RulesEngineInner rulesEngineParameters); + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RulesEngineInner createOrUpdate( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters, + Context context); + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String frontDoorName, String rulesEngineName); + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String frontDoorName, String rulesEngineName, Context context); + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 frontDoorName, String rulesEngineName); + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 frontDoorName, String rulesEngineName, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/CheckNameAvailabilityOutputInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/CheckNameAvailabilityOutputInner.java new file mode 100644 index 0000000000000..bb737a68b2a61 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/CheckNameAvailabilityOutputInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.Availability; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of check name availability API. */ +@Immutable +public final class CheckNameAvailabilityOutputInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityOutputInner.class); + + /* + * Indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailability", access = JsonProperty.Access.WRITE_ONLY) + private Availability nameAvailability; + + /* + * The reason why the name is not available. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * The detailed error message describing why the name is not available. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the nameAvailability property: Indicates whether the name is available. + * + * @return the nameAvailability value. + */ + public Availability nameAvailability() { + return this.nameAvailability; + } + + /** + * Get the reason property: The reason why the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: The detailed error message describing why the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ExperimentInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ExperimentInner.java new file mode 100644 index 0000000000000..61db0dac3ad27 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ExperimentInner.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.frontdoor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.Endpoint; +import com.azure.resourcemanager.frontdoor.models.NetworkExperimentResourceState; +import com.azure.resourcemanager.frontdoor.models.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the properties of an Experiment. */ +@JsonFlatten +@Fluent +public class ExperimentInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExperimentInner.class); + + /* + * The description of the details or intents of the Experiment + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The endpoint A of an experiment + */ + @JsonProperty(value = "properties.endpointA") + private Endpoint endpointA; + + /* + * The endpoint B of an experiment + */ + @JsonProperty(value = "properties.endpointB") + private Endpoint endpointB; + + /* + * The state of the Experiment + */ + @JsonProperty(value = "properties.enabledState") + private State enabledState; + + /* + * Resource status. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private NetworkExperimentResourceState resourceState; + + /* + * The description of Experiment status from the server side + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * The uri to the Script used in the Experiment + */ + @JsonProperty(value = "properties.scriptFileUri", access = JsonProperty.Access.WRITE_ONLY) + private String scriptFileUri; + + /** + * Get the description property: The description of the details or intents of the Experiment. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the details or intents of the Experiment. + * + * @param description the description value to set. + * @return the ExperimentInner object itself. + */ + public ExperimentInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the endpointA property: The endpoint A of an experiment. + * + * @return the endpointA value. + */ + public Endpoint endpointA() { + return this.endpointA; + } + + /** + * Set the endpointA property: The endpoint A of an experiment. + * + * @param endpointA the endpointA value to set. + * @return the ExperimentInner object itself. + */ + public ExperimentInner withEndpointA(Endpoint endpointA) { + this.endpointA = endpointA; + return this; + } + + /** + * Get the endpointB property: The endpoint B of an experiment. + * + * @return the endpointB value. + */ + public Endpoint endpointB() { + return this.endpointB; + } + + /** + * Set the endpointB property: The endpoint B of an experiment. + * + * @param endpointB the endpointB value to set. + * @return the ExperimentInner object itself. + */ + public ExperimentInner withEndpointB(Endpoint endpointB) { + this.endpointB = endpointB; + return this; + } + + /** + * Get the enabledState property: The state of the Experiment. + * + * @return the enabledState value. + */ + public State enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: The state of the Experiment. + * + * @param enabledState the enabledState value to set. + * @return the ExperimentInner object itself. + */ + public ExperimentInner withEnabledState(State enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public NetworkExperimentResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the status property: The description of Experiment status from the server side. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the scriptFileUri property: The uri to the Script used in the Experiment. + * + * @return the scriptFileUri value. + */ + public String scriptFileUri() { + return this.scriptFileUri; + } + + /** {@inheritDoc} */ + @Override + public ExperimentInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExperimentInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpointA() != null) { + endpointA().validate(); + } + if (endpointB() != null) { + endpointB().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/FrontDoorInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/FrontDoorInner.java new file mode 100644 index 0000000000000..579a658e1ceb6 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/FrontDoorInner.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.frontdoor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.BackendPool; +import com.azure.resourcemanager.frontdoor.models.BackendPoolsSettings; +import com.azure.resourcemanager.frontdoor.models.FrontDoorEnabledState; +import com.azure.resourcemanager.frontdoor.models.FrontDoorResourceState; +import com.azure.resourcemanager.frontdoor.models.HealthProbeSettingsModel; +import com.azure.resourcemanager.frontdoor.models.LoadBalancingSettingsModel; +import com.azure.resourcemanager.frontdoor.models.RoutingRule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Front Door represents a collection of backend endpoints to route traffic to along with rules that specify how traffic + * is sent there. + */ +@JsonFlatten +@Fluent +public class FrontDoorInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontDoorInner.class); + + /* + * A friendly name for the frontDoor + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /* + * Routing rules associated with this Front Door. + */ + @JsonProperty(value = "properties.routingRules") + private List routingRules; + + /* + * Load balancing settings associated with this Front Door instance. + */ + @JsonProperty(value = "properties.loadBalancingSettings") + private List loadBalancingSettings; + + /* + * Health probe settings associated with this Front Door instance. + */ + @JsonProperty(value = "properties.healthProbeSettings") + private List healthProbeSettings; + + /* + * Backend pools available to routing rules. + */ + @JsonProperty(value = "properties.backendPools") + private List backendPools; + + /* + * Frontend endpoints available to routing rules. + */ + @JsonProperty(value = "properties.frontendEndpoints") + private List frontendEndpoints; + + /* + * Settings for all backendPools + */ + @JsonProperty(value = "properties.backendPoolsSettings") + private BackendPoolsSettings backendPoolsSettings; + + /* + * Operational status of the Front Door load balancer. Permitted values are + * 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "properties.enabledState") + private FrontDoorEnabledState enabledState; + + /* + * Resource status of the Front Door. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /* + * Provisioning state of the Front Door. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The host that each frontendEndpoint must CNAME to. + */ + @JsonProperty(value = "properties.cname", access = JsonProperty.Access.WRITE_ONLY) + private String cname; + + /* + * The Id of the frontdoor. + */ + @JsonProperty(value = "properties.frontdoorId", access = JsonProperty.Access.WRITE_ONLY) + private String frontdoorId; + + /* + * Rules Engine Configurations available to routing rules. + */ + @JsonProperty(value = "properties.rulesEngines", access = JsonProperty.Access.WRITE_ONLY) + private List rulesEngines; + + /** + * Get the friendlyName property: A friendly name for the frontDoor. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: A friendly name for the frontDoor. + * + * @param friendlyName the friendlyName value to set. + * @return the FrontDoorInner object itself. + */ + public FrontDoorInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the routingRules property: Routing rules associated with this Front Door. + * + * @return the routingRules value. + */ + public List routingRules() { + return this.routingRules; + } + + /** + * Set the routingRules property: Routing rules associated with this Front Door. + * + * @param routingRules the routingRules value to set. + * @return the FrontDoorInner object itself. + */ + public FrontDoorInner withRoutingRules(List routingRules) { + this.routingRules = routingRules; + return this; + } + + /** + * Get the loadBalancingSettings property: Load balancing settings associated with this Front Door instance. + * + * @return the loadBalancingSettings value. + */ + public List loadBalancingSettings() { + return this.loadBalancingSettings; + } + + /** + * Set the loadBalancingSettings property: Load balancing settings associated with this Front Door instance. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the FrontDoorInner object itself. + */ + public FrontDoorInner withLoadBalancingSettings(List loadBalancingSettings) { + this.loadBalancingSettings = loadBalancingSettings; + return this; + } + + /** + * Get the healthProbeSettings property: Health probe settings associated with this Front Door instance. + * + * @return the healthProbeSettings value. + */ + public List healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: Health probe settings associated with this Front Door instance. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the FrontDoorInner object itself. + */ + public FrontDoorInner withHealthProbeSettings(List healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Get the backendPools property: Backend pools available to routing rules. + * + * @return the backendPools value. + */ + public List backendPools() { + return this.backendPools; + } + + /** + * Set the backendPools property: Backend pools available to routing rules. + * + * @param backendPools the backendPools value to set. + * @return the FrontDoorInner object itself. + */ + public FrontDoorInner withBackendPools(List backendPools) { + this.backendPools = backendPools; + return this; + } + + /** + * Get the frontendEndpoints property: Frontend endpoints available to routing rules. + * + * @return the frontendEndpoints value. + */ + public List frontendEndpoints() { + return this.frontendEndpoints; + } + + /** + * Set the frontendEndpoints property: Frontend endpoints available to routing rules. + * + * @param frontendEndpoints the frontendEndpoints value to set. + * @return the FrontDoorInner object itself. + */ + public FrontDoorInner withFrontendEndpoints(List frontendEndpoints) { + this.frontendEndpoints = frontendEndpoints; + return this; + } + + /** + * Get the backendPoolsSettings property: Settings for all backendPools. + * + * @return the backendPoolsSettings value. + */ + public BackendPoolsSettings backendPoolsSettings() { + return this.backendPoolsSettings; + } + + /** + * Set the backendPoolsSettings property: Settings for all backendPools. + * + * @param backendPoolsSettings the backendPoolsSettings value to set. + * @return the FrontDoorInner object itself. + */ + public FrontDoorInner withBackendPoolsSettings(BackendPoolsSettings backendPoolsSettings) { + this.backendPoolsSettings = backendPoolsSettings; + return this; + } + + /** + * Get the enabledState property: Operational status of the Front Door load balancer. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @return the enabledState value. + */ + public FrontDoorEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Operational status of the Front Door load balancer. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the FrontDoorInner object itself. + */ + public FrontDoorInner withEnabledState(FrontDoorEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the resourceState property: Resource status of the Front Door. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning state of the Front Door. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the cname property: The host that each frontendEndpoint must CNAME to. + * + * @return the cname value. + */ + public String cname() { + return this.cname; + } + + /** + * Get the frontdoorId property: The Id of the frontdoor. + * + * @return the frontdoorId value. + */ + public String frontdoorId() { + return this.frontdoorId; + } + + /** + * Get the rulesEngines property: Rules Engine Configurations available to routing rules. + * + * @return the rulesEngines value. + */ + public List rulesEngines() { + return this.rulesEngines; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routingRules() != null) { + routingRules().forEach(e -> e.validate()); + } + if (loadBalancingSettings() != null) { + loadBalancingSettings().forEach(e -> e.validate()); + } + if (healthProbeSettings() != null) { + healthProbeSettings().forEach(e -> e.validate()); + } + if (backendPools() != null) { + backendPools().forEach(e -> e.validate()); + } + if (frontendEndpoints() != null) { + frontendEndpoints().forEach(e -> e.validate()); + } + if (backendPoolsSettings() != null) { + backendPoolsSettings().validate(); + } + if (rulesEngines() != null) { + rulesEngines().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/FrontendEndpointInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/FrontendEndpointInner.java new file mode 100644 index 0000000000000..ba8de1f30e040 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/FrontendEndpointInner.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.CustomHttpsConfiguration; +import com.azure.resourcemanager.frontdoor.models.CustomHttpsProvisioningState; +import com.azure.resourcemanager.frontdoor.models.CustomHttpsProvisioningSubstate; +import com.azure.resourcemanager.frontdoor.models.FrontDoorResourceState; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.frontdoor.models.SessionAffinityEnabledState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A frontend endpoint used for routing. */ +@JsonFlatten +@Fluent +public class FrontendEndpointInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontendEndpointInner.class); + + /* + * Resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The host name of the frontendEndpoint. Must be a domain name. + */ + @JsonProperty(value = "properties.hostName") + private String hostname; + + /* + * Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "properties.sessionAffinityEnabledState") + private SessionAffinityEnabledState sessionAffinityEnabledState; + + /* + * UNUSED. This field will be ignored. The TTL to use in seconds for + * session affinity, if applicable. + */ + @JsonProperty(value = "properties.sessionAffinityTtlSeconds") + private Integer sessionAffinityTtlSeconds; + + /* + * Defines the Web Application Firewall policy for each host (if + * applicable) + */ + @JsonProperty(value = "properties.webApplicationFirewallPolicyLink") + private FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink; + + /* + * Resource status. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /* + * Provisioning status of Custom Https of the frontendEndpoint. + */ + @JsonProperty(value = "properties.customHttpsProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningState customHttpsProvisioningState; + + /* + * Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. + */ + @JsonProperty(value = "properties.customHttpsProvisioningSubstate", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate; + + /* + * The configuration specifying how to enable HTTPS + */ + @JsonProperty(value = "properties.customHttpsConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsConfiguration customHttpsConfiguration; + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the FrontendEndpointInner object itself. + */ + public FrontendEndpointInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the hostname property: The host name of the frontendEndpoint. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the frontendEndpoint. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the FrontendEndpointInner object itself. + */ + public FrontendEndpointInner withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the sessionAffinityEnabledState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityEnabledState value. + */ + public SessionAffinityEnabledState sessionAffinityEnabledState() { + return this.sessionAffinityEnabledState; + } + + /** + * Set the sessionAffinityEnabledState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @param sessionAffinityEnabledState the sessionAffinityEnabledState value to set. + * @return the FrontendEndpointInner object itself. + */ + public FrontendEndpointInner withSessionAffinityEnabledState( + SessionAffinityEnabledState sessionAffinityEnabledState) { + this.sessionAffinityEnabledState = sessionAffinityEnabledState; + return this; + } + + /** + * Get the sessionAffinityTtlSeconds property: UNUSED. This field will be ignored. The TTL to use in seconds for + * session affinity, if applicable. + * + * @return the sessionAffinityTtlSeconds value. + */ + public Integer sessionAffinityTtlSeconds() { + return this.sessionAffinityTtlSeconds; + } + + /** + * Set the sessionAffinityTtlSeconds property: UNUSED. This field will be ignored. The TTL to use in seconds for + * session affinity, if applicable. + * + * @param sessionAffinityTtlSeconds the sessionAffinityTtlSeconds value to set. + * @return the FrontendEndpointInner object itself. + */ + public FrontendEndpointInner withSessionAffinityTtlSeconds(Integer sessionAffinityTtlSeconds) { + this.sessionAffinityTtlSeconds = sessionAffinityTtlSeconds; + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for each host (if + * applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.webApplicationFirewallPolicyLink; + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for each host (if + * applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the FrontendEndpointInner object itself. + */ + public FrontendEndpointInner withWebApplicationFirewallPolicyLink( + FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + this.webApplicationFirewallPolicyLink = webApplicationFirewallPolicyLink; + return this; + } + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the customHttpsProvisioningState property: Provisioning status of Custom Https of the frontendEndpoint. + * + * @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 customHttpsConfiguration property: The configuration specifying how to enable HTTPS. + * + * @return the customHttpsConfiguration value. + */ + public CustomHttpsConfiguration customHttpsConfiguration() { + return this.customHttpsConfiguration; + } + + /** {@inheritDoc} */ + @Override + public FrontendEndpointInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webApplicationFirewallPolicyLink() != null) { + webApplicationFirewallPolicyLink().validate(); + } + if (customHttpsConfiguration() != null) { + customHttpsConfiguration().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/LatencyScorecardInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/LatencyScorecardInner.java new file mode 100644 index 0000000000000..7c5cec1f42723 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/LatencyScorecardInner.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.frontdoor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.LatencyMetric; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Defines the LatencyScorecard. */ +@JsonFlatten +@Fluent +public class LatencyScorecardInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LatencyScorecardInner.class); + + /* + * The unique identifier of the Latency Scorecard + */ + @JsonProperty(value = "properties.id", access = JsonProperty.Access.WRITE_ONLY) + private String idPropertiesId; + + /* + * The name of the Latency Scorecard + */ + @JsonProperty(value = "properties.name", access = JsonProperty.Access.WRITE_ONLY) + private String namePropertiesName; + + /* + * The description of the Latency Scorecard + */ + @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The A endpoint in the scorecard + */ + @JsonProperty(value = "properties.endpointA", access = JsonProperty.Access.WRITE_ONLY) + private String endpointA; + + /* + * The B endpoint in the scorecard + */ + @JsonProperty(value = "properties.endpointB", access = JsonProperty.Access.WRITE_ONLY) + private String endpointB; + + /* + * The start time of the Latency Scorecard in UTC + */ + @JsonProperty(value = "properties.startDateTimeUTC", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startDateTimeUtc; + + /* + * The end time of the Latency Scorecard in UTC + */ + @JsonProperty(value = "properties.endDateTimeUTC", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endDateTimeUtc; + + /* + * The country associated with the Latency Scorecard. Values are country + * ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html + */ + @JsonProperty(value = "properties.country", access = JsonProperty.Access.WRITE_ONLY) + private String country; + + /* + * The latency metrics of the Latency Scorecard + */ + @JsonProperty(value = "properties.latencyMetrics") + private List latencyMetrics; + + /** + * Get the idPropertiesId property: The unique identifier of the Latency Scorecard. + * + * @return the idPropertiesId value. + */ + public String idPropertiesId() { + return this.idPropertiesId; + } + + /** + * Get the namePropertiesName property: The name of the Latency Scorecard. + * + * @return the namePropertiesName value. + */ + public String namePropertiesName() { + return this.namePropertiesName; + } + + /** + * Get the description property: The description of the Latency Scorecard. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the endpointA property: The A endpoint in the scorecard. + * + * @return the endpointA value. + */ + public String endpointA() { + return this.endpointA; + } + + /** + * Get the endpointB property: The B endpoint in the scorecard. + * + * @return the endpointB value. + */ + public String endpointB() { + return this.endpointB; + } + + /** + * Get the startDateTimeUtc property: The start time of the Latency Scorecard in UTC. + * + * @return the startDateTimeUtc value. + */ + public OffsetDateTime startDateTimeUtc() { + return this.startDateTimeUtc; + } + + /** + * Get the endDateTimeUtc property: The end time of the Latency Scorecard in UTC. + * + * @return the endDateTimeUtc value. + */ + public OffsetDateTime endDateTimeUtc() { + return this.endDateTimeUtc; + } + + /** + * Get the country property: The country associated with the Latency Scorecard. Values are country ISO codes as + * specified here- https://www.iso.org/iso-3166-country-codes.html. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Get the latencyMetrics property: The latency metrics of the Latency Scorecard. + * + * @return the latencyMetrics value. + */ + public List latencyMetrics() { + return this.latencyMetrics; + } + + /** + * Set the latencyMetrics property: The latency metrics of the Latency Scorecard. + * + * @param latencyMetrics the latencyMetrics value to set. + * @return the LatencyScorecardInner object itself. + */ + public LatencyScorecardInner withLatencyMetrics(List latencyMetrics) { + this.latencyMetrics = latencyMetrics; + return this; + } + + /** {@inheritDoc} */ + @Override + public LatencyScorecardInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LatencyScorecardInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (latencyMetrics() != null) { + latencyMetrics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ManagedRuleSetDefinitionInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ManagedRuleSetDefinitionInner.java new file mode 100644 index 0000000000000..d3a588629a6db --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ManagedRuleSetDefinitionInner.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.frontdoor.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.ManagedRuleGroupDefinition; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes the a managed rule set definition. */ +@JsonFlatten +@Immutable +public class ManagedRuleSetDefinitionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSetDefinitionInner.class); + + /* + * Provisioning state of the managed rule set. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Id of the managed rule set. + */ + @JsonProperty(value = "properties.ruleSetId", access = JsonProperty.Access.WRITE_ONLY) + private String ruleSetId; + + /* + * Type of the managed rule set. + */ + @JsonProperty(value = "properties.ruleSetType", access = JsonProperty.Access.WRITE_ONLY) + private String ruleSetType; + + /* + * Version of the managed rule set type. + */ + @JsonProperty(value = "properties.ruleSetVersion", access = JsonProperty.Access.WRITE_ONLY) + private String ruleSetVersion; + + /* + * Rule groups of the managed rule set. + */ + @JsonProperty(value = "properties.ruleGroups", access = JsonProperty.Access.WRITE_ONLY) + private List ruleGroups; + + /** + * Get the provisioningState property: Provisioning state of the managed rule set. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the ruleSetId property: Id of the managed rule set. + * + * @return the ruleSetId value. + */ + public String ruleSetId() { + return this.ruleSetId; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public ManagedRuleSetDefinitionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedRuleSetDefinitionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/PreconfiguredEndpointInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/PreconfiguredEndpointInner.java new file mode 100644 index 0000000000000..98c97981c3af7 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/PreconfiguredEndpointInner.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.frontdoor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.EndpointType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the properties of a preconfigured endpoint. */ +@JsonFlatten +@Fluent +public class PreconfiguredEndpointInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PreconfiguredEndpointInner.class); + + /* + * The description of the endpoint + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The endpoint that is preconfigured + */ + @JsonProperty(value = "properties.endpoint") + private String endpoint; + + /* + * The type of endpoint + */ + @JsonProperty(value = "properties.endpointType") + private EndpointType endpointType; + + /* + * The preconfigured endpoint backend + */ + @JsonProperty(value = "properties.backend") + private String backend; + + /** + * Get the description property: The description of the endpoint. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the endpoint. + * + * @param description the description value to set. + * @return the PreconfiguredEndpointInner object itself. + */ + public PreconfiguredEndpointInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the endpoint property: The endpoint that is preconfigured. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: The endpoint that is preconfigured. + * + * @param endpoint the endpoint value to set. + * @return the PreconfiguredEndpointInner object itself. + */ + public PreconfiguredEndpointInner withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the endpointType property: The type of endpoint. + * + * @return the endpointType value. + */ + public EndpointType endpointType() { + return this.endpointType; + } + + /** + * Set the endpointType property: The type of endpoint. + * + * @param endpointType the endpointType value to set. + * @return the PreconfiguredEndpointInner object itself. + */ + public PreconfiguredEndpointInner withEndpointType(EndpointType endpointType) { + this.endpointType = endpointType; + return this; + } + + /** + * Get the backend property: The preconfigured endpoint backend. + * + * @return the backend value. + */ + public String backend() { + return this.backend; + } + + /** + * Set the backend property: The preconfigured endpoint backend. + * + * @param backend the backend value to set. + * @return the PreconfiguredEndpointInner object itself. + */ + public PreconfiguredEndpointInner withBackend(String backend) { + this.backend = backend; + return this; + } + + /** {@inheritDoc} */ + @Override + public PreconfiguredEndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PreconfiguredEndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ProfileInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ProfileInner.java new file mode 100644 index 0000000000000..16bd9705eeb6f --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ProfileInner.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.frontdoor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.NetworkExperimentResourceState; +import com.azure.resourcemanager.frontdoor.models.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines an Network Experiment Profile and lists of Experiments. */ +@JsonFlatten +@Fluent +public class ProfileInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProfileInner.class); + + /* + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * Resource status. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private NetworkExperimentResourceState resourceState; + + /* + * The state of the Experiment + */ + @JsonProperty(value = "properties.enabledState") + private State enabledState; + + /** + * 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 ProfileInner object itself. + */ + public ProfileInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public NetworkExperimentResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the enabledState property: The state of the Experiment. + * + * @return the enabledState value. + */ + public State enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: The state of the Experiment. + * + * @param enabledState the enabledState value to set. + * @return the ProfileInner object itself. + */ + public ProfileInner withEnabledState(State enabledState) { + this.enabledState = enabledState; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/RulesEngineInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/RulesEngineInner.java new file mode 100644 index 0000000000000..4ddb1316616cb --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/RulesEngineInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.FrontDoorResourceState; +import com.azure.resourcemanager.frontdoor.models.RulesEngineRule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A rules engine configuration containing a list of rules that will run to modify the runtime behavior of the request + * and response. + */ +@JsonFlatten +@Fluent +public class RulesEngineInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesEngineInner.class); + + /* + * A list of rules that define a particular Rules Engine Configuration. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /* + * Resource status. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the rules property: A list of rules that define a particular Rules Engine Configuration. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: A list of rules that define a particular Rules Engine Configuration. + * + * @param rules the rules value to set. + * @return the RulesEngineInner object itself. + */ + public RulesEngineInner withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/TimeseriesInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/TimeseriesInner.java new file mode 100644 index 0000000000000..501e4766d0995 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/TimeseriesInner.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.frontdoor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.AggregationInterval; +import com.azure.resourcemanager.frontdoor.models.TimeseriesDataPoint; +import com.azure.resourcemanager.frontdoor.models.TimeseriesType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Defines the Timeseries. */ +@JsonFlatten +@Fluent +public class TimeseriesInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeseriesInner.class); + + /* + * The endpoint associated with the Timeseries data point + */ + @JsonProperty(value = "properties.endpoint") + private String endpoint; + + /* + * The start DateTime of the Timeseries in UTC + */ + @JsonProperty(value = "properties.startDateTimeUTC") + private String startDateTimeUtc; + + /* + * The end DateTime of the Timeseries in UTC + */ + @JsonProperty(value = "properties.endDateTimeUTC") + private String endDateTimeUtc; + + /* + * The aggregation interval of the Timeseries + */ + @JsonProperty(value = "properties.aggregationInterval") + private AggregationInterval aggregationInterval; + + /* + * The type of Timeseries + */ + @JsonProperty(value = "properties.timeseriesType") + private TimeseriesType timeseriesType; + + /* + * The country associated with the Timeseries. Values are country ISO codes + * as specified here- https://www.iso.org/iso-3166-country-codes.html + */ + @JsonProperty(value = "properties.country") + private String country; + + /* + * The set of data points for the timeseries + */ + @JsonProperty(value = "properties.timeseriesData") + private List timeseriesData; + + /** + * Get the endpoint property: The endpoint associated with the Timeseries data point. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: The endpoint associated with the Timeseries data point. + * + * @param endpoint the endpoint value to set. + * @return the TimeseriesInner object itself. + */ + public TimeseriesInner withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the startDateTimeUtc property: The start DateTime of the Timeseries in UTC. + * + * @return the startDateTimeUtc value. + */ + public String startDateTimeUtc() { + return this.startDateTimeUtc; + } + + /** + * Set the startDateTimeUtc property: The start DateTime of the Timeseries in UTC. + * + * @param startDateTimeUtc the startDateTimeUtc value to set. + * @return the TimeseriesInner object itself. + */ + public TimeseriesInner withStartDateTimeUtc(String startDateTimeUtc) { + this.startDateTimeUtc = startDateTimeUtc; + return this; + } + + /** + * Get the endDateTimeUtc property: The end DateTime of the Timeseries in UTC. + * + * @return the endDateTimeUtc value. + */ + public String endDateTimeUtc() { + return this.endDateTimeUtc; + } + + /** + * Set the endDateTimeUtc property: The end DateTime of the Timeseries in UTC. + * + * @param endDateTimeUtc the endDateTimeUtc value to set. + * @return the TimeseriesInner object itself. + */ + public TimeseriesInner withEndDateTimeUtc(String endDateTimeUtc) { + this.endDateTimeUtc = endDateTimeUtc; + return this; + } + + /** + * Get the aggregationInterval property: The aggregation interval of the Timeseries. + * + * @return the aggregationInterval value. + */ + public AggregationInterval aggregationInterval() { + return this.aggregationInterval; + } + + /** + * Set the aggregationInterval property: The aggregation interval of the Timeseries. + * + * @param aggregationInterval the aggregationInterval value to set. + * @return the TimeseriesInner object itself. + */ + public TimeseriesInner withAggregationInterval(AggregationInterval aggregationInterval) { + this.aggregationInterval = aggregationInterval; + return this; + } + + /** + * Get the timeseriesType property: The type of Timeseries. + * + * @return the timeseriesType value. + */ + public TimeseriesType timeseriesType() { + return this.timeseriesType; + } + + /** + * Set the timeseriesType property: The type of Timeseries. + * + * @param timeseriesType the timeseriesType value to set. + * @return the TimeseriesInner object itself. + */ + public TimeseriesInner withTimeseriesType(TimeseriesType timeseriesType) { + this.timeseriesType = timeseriesType; + return this; + } + + /** + * Get the country property: The country associated with the Timeseries. Values are country ISO codes as specified + * here- https://www.iso.org/iso-3166-country-codes.html. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: The country associated with the Timeseries. Values are country ISO codes as specified + * here- https://www.iso.org/iso-3166-country-codes.html. + * + * @param country the country value to set. + * @return the TimeseriesInner object itself. + */ + public TimeseriesInner withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the timeseriesData property: The set of data points for the timeseries. + * + * @return the timeseriesData value. + */ + public List timeseriesData() { + return this.timeseriesData; + } + + /** + * Set the timeseriesData property: The set of data points for the timeseries. + * + * @param timeseriesData the timeseriesData value to set. + * @return the TimeseriesInner object itself. + */ + public TimeseriesInner withTimeseriesData(List timeseriesData) { + this.timeseriesData = timeseriesData; + return this; + } + + /** {@inheritDoc} */ + @Override + public TimeseriesInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public TimeseriesInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timeseriesData() != null) { + timeseriesData().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ValidateCustomDomainOutputInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ValidateCustomDomainOutputInner.java new file mode 100644 index 0000000000000..470270d3768b9 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/ValidateCustomDomainOutputInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of custom domain validation. */ +@Immutable +public final class ValidateCustomDomainOutputInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateCustomDomainOutputInner.class); + + /* + * Indicates whether the custom domain is valid or not. + */ + @JsonProperty(value = "customDomainValidated", access = JsonProperty.Access.WRITE_ONLY) + private Boolean customDomainValidated; + + /* + * The reason why the custom domain is not valid. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * Error message describing why the custom domain is not valid. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the customDomainValidated property: Indicates whether the custom domain is valid or not. + * + * @return the customDomainValidated value. + */ + public Boolean customDomainValidated() { + return this.customDomainValidated; + } + + /** + * Get the reason property: The reason why the custom domain is not valid. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: Error message describing why the custom domain is not valid. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/WebApplicationFirewallPolicyInner.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/WebApplicationFirewallPolicyInner.java new file mode 100644 index 0000000000000..2030bc78a0b1d --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/WebApplicationFirewallPolicyInner.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.models.CustomRuleList; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpointLink; +import com.azure.resourcemanager.frontdoor.models.ManagedRuleSetList; +import com.azure.resourcemanager.frontdoor.models.PolicyResourceState; +import com.azure.resourcemanager.frontdoor.models.PolicySettings; +import com.azure.resourcemanager.frontdoor.models.RoutingRuleLink; +import com.azure.resourcemanager.frontdoor.models.SecurityPolicyLink; +import com.azure.resourcemanager.frontdoor.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Defines web application firewall policy. */ +@JsonFlatten +@Fluent +public class WebApplicationFirewallPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPolicyInner.class); + + /* + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The pricing tier of web application firewall policy. Defaults to + * Classic_AzureFrontDoor if not specified. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Describes settings for the policy. + */ + @JsonProperty(value = "properties.policySettings") + private PolicySettings policySettings; + + /* + * Describes custom rules inside the policy. + */ + @JsonProperty(value = "properties.customRules") + private CustomRuleList customRules; + + /* + * Describes managed rules inside the policy. + */ + @JsonProperty(value = "properties.managedRules") + private ManagedRuleSetList managedRules; + + /* + * Describes Frontend Endpoints associated with this Web Application + * Firewall policy. + */ + @JsonProperty(value = "properties.frontendEndpointLinks", access = JsonProperty.Access.WRITE_ONLY) + private List frontendEndpointLinks; + + /* + * Describes Routing Rules associated with this Web Application Firewall + * policy. + */ + @JsonProperty(value = "properties.routingRuleLinks", access = JsonProperty.Access.WRITE_ONLY) + private List routingRuleLinks; + + /* + * Describes Security Policy associated with this Web Application Firewall + * policy. + */ + @JsonProperty(value = "properties.securityPolicyLinks", access = JsonProperty.Access.WRITE_ONLY) + private List securityPolicyLinks; + + /* + * Provisioning state of the policy. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Resource status of the policy. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private PolicyResourceState resourceState; + + /** + * 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 WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the sku property: The pricing tier of web application firewall policy. Defaults to Classic_AzureFrontDoor if + * not specified. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The pricing tier of web application firewall policy. Defaults to Classic_AzureFrontDoor if + * not specified. + * + * @param sku the sku value to set. + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the policySettings property: Describes settings for the policy. + * + * @return the policySettings value. + */ + public PolicySettings policySettings() { + return this.policySettings; + } + + /** + * Set the policySettings property: Describes settings for the policy. + * + * @param policySettings the policySettings value to set. + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withPolicySettings(PolicySettings policySettings) { + this.policySettings = policySettings; + 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 WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner 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 WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withManagedRules(ManagedRuleSetList managedRules) { + this.managedRules = managedRules; + return this; + } + + /** + * Get the frontendEndpointLinks property: Describes Frontend Endpoints associated with this Web Application + * Firewall policy. + * + * @return the frontendEndpointLinks value. + */ + public List frontendEndpointLinks() { + return this.frontendEndpointLinks; + } + + /** + * Get the routingRuleLinks property: Describes Routing Rules associated with this Web Application Firewall policy. + * + * @return the routingRuleLinks value. + */ + public List routingRuleLinks() { + return this.routingRuleLinks; + } + + /** + * Get the securityPolicyLinks property: Describes Security Policy associated with this Web Application Firewall + * policy. + * + * @return the securityPolicyLinks value. + */ + public List securityPolicyLinks() { + return this.securityPolicyLinks; + } + + /** + * Get the provisioningState property: Provisioning state of the policy. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + public PolicyResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public WebApplicationFirewallPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WebApplicationFirewallPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (policySettings() != null) { + policySettings().validate(); + } + if (customRules() != null) { + customRules().validate(); + } + if (managedRules() != null) { + managedRules().validate(); + } + if (frontendEndpointLinks() != null) { + frontendEndpointLinks().forEach(e -> e.validate()); + } + if (routingRuleLinks() != null) { + routingRuleLinks().forEach(e -> e.validate()); + } + if (securityPolicyLinks() != null) { + securityPolicyLinks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/package-info.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/package-info.java new file mode 100644 index 0000000000000..c991b0475e1d6 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for FrontDoorManagementClient. FrontDoor Client. */ +package com.azure.resourcemanager.frontdoor.fluent.models; diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/package-info.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/package-info.java new file mode 100644 index 0000000000000..4e3b175c470b4 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for FrontDoorManagementClient. FrontDoor Client. */ +package com.azure.resourcemanager.frontdoor.fluent; diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/CheckNameAvailabilityOutputImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/CheckNameAvailabilityOutputImpl.java new file mode 100644 index 0000000000000..7469cd7831e68 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/CheckNameAvailabilityOutputImpl.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.frontdoor.implementation; + +import com.azure.resourcemanager.frontdoor.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.frontdoor.models.Availability; +import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityOutput; + +public final class CheckNameAvailabilityOutputImpl implements CheckNameAvailabilityOutput { + private CheckNameAvailabilityOutputInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + CheckNameAvailabilityOutputImpl( + CheckNameAvailabilityOutputInner innerObject, + com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Availability nameAvailability() { + return this.innerModel().nameAvailability(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/EndpointsClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/EndpointsClientImpl.java new file mode 100644 index 0000000000000..455393daf88aa --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/EndpointsClientImpl.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.frontdoor.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.frontdoor.fluent.EndpointsClient; +import com.azure.resourcemanager.frontdoor.models.PurgeParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EndpointsClient. */ +public final class EndpointsClientImpl implements EndpointsClient { + private final ClientLogger logger = new ClientLogger(EndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EndpointsService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of EndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EndpointsClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy.create(EndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientEndpoints to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface EndpointsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/purge") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purgeContent( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PurgeParameters contentFilePaths, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeContentWithResponseAsync( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName 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 apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .purgeContent( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + contentFilePaths, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeContentWithResponseAsync( + String resourceGroupName, String frontDoorName, 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 (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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName 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 apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .purgeContent( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + contentFilePaths, + accept, + context); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPurgeContentAsync( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths) { + Mono>> mono = + purgeContentWithResponseAsync(resourceGroupName, frontDoorName, contentFilePaths); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPurgeContentAsync( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + purgeContentWithResponseAsync(resourceGroupName, frontDoorName, contentFilePaths, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPurgeContent( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths) { + return beginPurgeContentAsync(resourceGroupName, frontDoorName, contentFilePaths).getSyncPoller(); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPurgeContent( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths, Context context) { + return beginPurgeContentAsync(resourceGroupName, frontDoorName, contentFilePaths, context).getSyncPoller(); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeContentAsync( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths) { + return beginPurgeContentAsync(resourceGroupName, frontDoorName, contentFilePaths) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeContentAsync( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths, Context context) { + return beginPurgeContentAsync(resourceGroupName, frontDoorName, contentFilePaths, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @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 frontDoorName, PurgeParameters contentFilePaths) { + purgeContentAsync(resourceGroupName, frontDoorName, contentFilePaths).block(); + } + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @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 frontDoorName, PurgeParameters contentFilePaths, Context context) { + purgeContentAsync(resourceGroupName, frontDoorName, contentFilePaths, context).block(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/EndpointsImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/EndpointsImpl.java new file mode 100644 index 0000000000000..48787055b2838 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/EndpointsImpl.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.frontdoor.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.EndpointsClient; +import com.azure.resourcemanager.frontdoor.models.Endpoints; +import com.azure.resourcemanager.frontdoor.models.PurgeParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EndpointsImpl implements Endpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointsImpl.class); + + private final EndpointsClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public EndpointsImpl( + EndpointsClient innerClient, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void purgeContent(String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths) { + this.serviceClient().purgeContent(resourceGroupName, frontDoorName, contentFilePaths); + } + + public void purgeContent( + String resourceGroupName, String frontDoorName, PurgeParameters contentFilePaths, Context context) { + this.serviceClient().purgeContent(resourceGroupName, frontDoorName, contentFilePaths, context); + } + + private EndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentImpl.java new file mode 100644 index 0000000000000..eecde8222c116 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentImpl.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.frontdoor.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.fluent.models.ExperimentInner; +import com.azure.resourcemanager.frontdoor.models.Endpoint; +import com.azure.resourcemanager.frontdoor.models.Experiment; +import com.azure.resourcemanager.frontdoor.models.ExperimentUpdateModel; +import com.azure.resourcemanager.frontdoor.models.NetworkExperimentResourceState; +import com.azure.resourcemanager.frontdoor.models.State; +import java.util.Collections; +import java.util.Map; + +public final class ExperimentImpl implements Experiment, Experiment.Definition, Experiment.Update { + private ExperimentInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager 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 description() { + return this.innerModel().description(); + } + + public Endpoint endpointA() { + return this.innerModel().endpointA(); + } + + public Endpoint endpointB() { + return this.innerModel().endpointB(); + } + + public State enabledState() { + return this.innerModel().enabledState(); + } + + public NetworkExperimentResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public String status() { + return this.innerModel().status(); + } + + public String scriptFileUri() { + return this.innerModel().scriptFileUri(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExperimentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String experimentName; + + private ExperimentUpdateModel updateParameters; + + public ExperimentImpl withExistingNetworkExperimentProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public Experiment create() { + this.innerObject = + serviceManager + .serviceClient() + .getExperiments() + .createOrUpdate(resourceGroupName, profileName, experimentName, this.innerModel(), Context.NONE); + return this; + } + + public Experiment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExperiments() + .createOrUpdate(resourceGroupName, profileName, experimentName, this.innerModel(), context); + return this; + } + + ExperimentImpl(String name, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = new ExperimentInner(); + this.serviceManager = serviceManager; + this.experimentName = name; + } + + public ExperimentImpl update() { + this.updateParameters = new ExperimentUpdateModel(); + return this; + } + + public Experiment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExperiments() + .update(resourceGroupName, profileName, experimentName, updateParameters, Context.NONE); + return this; + } + + public Experiment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExperiments() + .update(resourceGroupName, profileName, experimentName, updateParameters, context); + return this; + } + + ExperimentImpl(ExperimentInner innerObject, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "NetworkExperimentProfiles"); + this.experimentName = Utils.getValueFromIdByName(innerObject.id(), "Experiments"); + } + + public Experiment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExperiments() + .getWithResponse(resourceGroupName, profileName, experimentName, Context.NONE) + .getValue(); + return this; + } + + public Experiment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExperiments() + .getWithResponse(resourceGroupName, profileName, experimentName, context) + .getValue(); + return this; + } + + public ExperimentImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExperimentImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExperimentImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ExperimentImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public ExperimentImpl withEndpointA(Endpoint endpointA) { + this.innerModel().withEndpointA(endpointA); + return this; + } + + public ExperimentImpl withEndpointB(Endpoint endpointB) { + this.innerModel().withEndpointB(endpointB); + return this; + } + + public ExperimentImpl withEnabledState(State enabledState) { + if (isInCreateMode()) { + this.innerModel().withEnabledState(enabledState); + return this; + } else { + this.updateParameters.withEnabledState(enabledState); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentsClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentsClientImpl.java new file mode 100644 index 0000000000000..d63b08ef7b605 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentsClientImpl.java @@ -0,0 +1,1439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.frontdoor.fluent.ExperimentsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.ExperimentInner; +import com.azure.resourcemanager.frontdoor.models.ExperimentList; +import com.azure.resourcemanager.frontdoor.models.ExperimentUpdateModel; +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 ExperimentsClient. */ +public final class ExperimentsClientImpl implements ExperimentsClient { + private final ClientLogger logger = new ClientLogger(ExperimentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExperimentsService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of ExperimentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExperimentsClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy.create(ExperimentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientExperiments to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface ExperimentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}/Experiments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("experimentName") String experimentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("experimentName") String experimentName, + @BodyParam("application/json") ExperimentInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("experimentName") String experimentName, + @BodyParam("application/json") ExperimentUpdateModel parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("experimentName") String experimentName, + @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); + } + + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Experiments. + */ + @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 (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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProfile( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + 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())); + } + + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Experiments. + */ + @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 (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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProfile( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Experiments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Experiments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync( + String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Experiments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Experiments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an Experiment by ExperimentName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Experiment by ExperimentName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String experimentName) { + 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Experiment by ExperimentName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Experiment by ExperimentName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String experimentName, 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + accept, + context); + } + + /** + * Gets an Experiment by ExperimentName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Experiment by ExperimentName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String experimentName) { + return getWithResponseAsync(resourceGroupName, profileName, experimentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an Experiment by ExperimentName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Experiment by ExperimentName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExperimentInner get(String resourceGroupName, String profileName, String experimentName) { + return getAsync(resourceGroupName, profileName, experimentName).block(); + } + + /** + * Gets an Experiment by ExperimentName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Experiment by ExperimentName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String experimentName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, experimentName, context).block(); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String profileName, String experimentName, ExperimentInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + parameters, + accept, + context); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String profileName, String experimentName, ExperimentInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, profileName, experimentName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, Context.NONE); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, profileName, experimentName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, context); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExperimentInner> beginCreateOrUpdate( + String resourceGroupName, String profileName, String experimentName, ExperimentInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExperimentInner> beginCreateOrUpdate( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String profileName, String experimentName, ExperimentInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExperimentInner createOrUpdate( + String resourceGroupName, String profileName, String experimentName, ExperimentInner parameters) { + return createOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters).block(); + } + + /** + * Creates or updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExperimentInner createOrUpdate( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context).block(); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String profileName, String experimentName, ExperimentUpdateModel parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentUpdateModel parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + parameters, + accept, + context); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExperimentInner> beginUpdateAsync( + String resourceGroupName, String profileName, String experimentName, ExperimentUpdateModel parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, experimentName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, Context.NONE); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExperimentInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentUpdateModel parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, experimentName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, context); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExperimentInner> beginUpdate( + String resourceGroupName, String profileName, String experimentName, ExperimentUpdateModel parameters) { + return beginUpdateAsync(resourceGroupName, profileName, experimentName, parameters).getSyncPoller(); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExperimentInner> beginUpdate( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentUpdateModel parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context).getSyncPoller(); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String profileName, String experimentName, ExperimentUpdateModel parameters) { + return beginUpdateAsync(resourceGroupName, profileName, experimentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentUpdateModel parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExperimentInner update( + String resourceGroupName, String profileName, String experimentName, ExperimentUpdateModel parameters) { + return updateAsync(resourceGroupName, profileName, experimentName, parameters).block(); + } + + /** + * Updates an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param parameters The Experiment Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the properties of an Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExperimentInner update( + String resourceGroupName, + String profileName, + String experimentName, + ExperimentUpdateModel parameters, + Context context) { + return updateAsync(resourceGroupName, profileName, experimentName, parameters, context).block(); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String profileName, String experimentName) { + 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String profileName, String experimentName, 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + accept, + context); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String profileName, String experimentName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, experimentName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String profileName, String experimentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, experimentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String profileName, String experimentName) { + return beginDeleteAsync(resourceGroupName, profileName, experimentName).getSyncPoller(); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String profileName, String experimentName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, experimentName, context).getSyncPoller(); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, String experimentName) { + return beginDeleteAsync(resourceGroupName, profileName, experimentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String profileName, String experimentName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, experimentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 experimentName) { + deleteAsync(resourceGroupName, profileName, experimentName).block(); + } + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 experimentName, Context context) { + deleteAsync(resourceGroupName, profileName, experimentName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of Experiments. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of Experiments. + */ + @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/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentsImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentsImpl.java new file mode 100644 index 0000000000000..d45679e883948 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ExperimentsImpl.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.frontdoor.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.frontdoor.fluent.ExperimentsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.ExperimentInner; +import com.azure.resourcemanager.frontdoor.models.Experiment; +import com.azure.resourcemanager.frontdoor.models.Experiments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExperimentsImpl implements Experiments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExperimentsImpl.class); + + private final ExperimentsClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public ExperimentsImpl( + ExperimentsClient innerClient, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new ExperimentImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new ExperimentImpl(inner1, this.manager())); + } + + public Experiment get(String resourceGroupName, String profileName, String experimentName) { + ExperimentInner inner = this.serviceClient().get(resourceGroupName, profileName, experimentName); + if (inner != null) { + return new ExperimentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String experimentName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, experimentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExperimentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String experimentName) { + this.serviceClient().delete(resourceGroupName, profileName, experimentName); + } + + public void delete(String resourceGroupName, String profileName, String experimentName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, experimentName, context); + } + + public Experiment getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "NetworkExperimentProfiles"); + if (profileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'NetworkExperimentProfiles'.", + id))); + } + String experimentName = Utils.getValueFromIdByName(id, "Experiments"); + if (experimentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Experiments'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, experimentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "NetworkExperimentProfiles"); + if (profileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'NetworkExperimentProfiles'.", + id))); + } + String experimentName = Utils.getValueFromIdByName(id, "Experiments"); + if (experimentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Experiments'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, experimentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "NetworkExperimentProfiles"); + if (profileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'NetworkExperimentProfiles'.", + id))); + } + String experimentName = Utils.getValueFromIdByName(id, "Experiments"); + if (experimentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Experiments'.", id))); + } + this.delete(resourceGroupName, profileName, experimentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "NetworkExperimentProfiles"); + if (profileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'NetworkExperimentProfiles'.", + id))); + } + String experimentName = Utils.getValueFromIdByName(id, "Experiments"); + if (experimentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Experiments'.", id))); + } + this.delete(resourceGroupName, profileName, experimentName, context); + } + + private ExperimentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + public ExperimentImpl define(String name) { + return new ExperimentImpl(name, this.manager()); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorImpl.java new file mode 100644 index 0000000000000..a0ca9f03f66f1 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorImpl.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontDoorInner; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner; +import com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner; +import com.azure.resourcemanager.frontdoor.models.BackendPool; +import com.azure.resourcemanager.frontdoor.models.BackendPoolsSettings; +import com.azure.resourcemanager.frontdoor.models.FrontDoor; +import com.azure.resourcemanager.frontdoor.models.FrontDoorEnabledState; +import com.azure.resourcemanager.frontdoor.models.FrontDoorResourceState; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpoint; +import com.azure.resourcemanager.frontdoor.models.HealthProbeSettingsModel; +import com.azure.resourcemanager.frontdoor.models.LoadBalancingSettingsModel; +import com.azure.resourcemanager.frontdoor.models.RoutingRule; +import com.azure.resourcemanager.frontdoor.models.RulesEngine; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class FrontDoorImpl implements FrontDoor, FrontDoor.Definition, FrontDoor.Update { + private FrontDoorInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager 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 friendlyName() { + return this.innerModel().friendlyName(); + } + + public List routingRules() { + List inner = this.innerModel().routingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancingSettings() { + List inner = this.innerModel().loadBalancingSettings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List healthProbeSettings() { + List inner = this.innerModel().healthProbeSettings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List backendPools() { + List inner = this.innerModel().backendPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List frontendEndpoints() { + List inner = this.innerModel().frontendEndpoints(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new FrontendEndpointImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public BackendPoolsSettings backendPoolsSettings() { + return this.innerModel().backendPoolsSettings(); + } + + public FrontDoorEnabledState enabledState() { + return this.innerModel().enabledState(); + } + + public FrontDoorResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String cname() { + return this.innerModel().cname(); + } + + public String frontdoorId() { + return this.innerModel().frontdoorId(); + } + + public List rulesEngines() { + List inner = this.innerModel().rulesEngines(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new RulesEngineImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public FrontDoorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String frontDoorName; + + public FrontDoorImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public FrontDoor create() { + this.innerObject = + serviceManager + .serviceClient() + .getFrontDoors() + .createOrUpdate(resourceGroupName, frontDoorName, this.innerModel(), Context.NONE); + return this; + } + + public FrontDoor create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFrontDoors() + .createOrUpdate(resourceGroupName, frontDoorName, this.innerModel(), context); + return this; + } + + FrontDoorImpl(String name, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = new FrontDoorInner(); + this.serviceManager = serviceManager; + this.frontDoorName = name; + } + + public FrontDoorImpl update() { + return this; + } + + public FrontDoor apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFrontDoors() + .createOrUpdate(resourceGroupName, frontDoorName, this.innerModel(), Context.NONE); + return this; + } + + public FrontDoor apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFrontDoors() + .createOrUpdate(resourceGroupName, frontDoorName, this.innerModel(), context); + return this; + } + + FrontDoorImpl(FrontDoorInner innerObject, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.frontDoorName = Utils.getValueFromIdByName(innerObject.id(), "frontDoors"); + } + + public FrontDoor refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFrontDoors() + .getByResourceGroupWithResponse(resourceGroupName, frontDoorName, Context.NONE) + .getValue(); + return this; + } + + public FrontDoor refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFrontDoors() + .getByResourceGroupWithResponse(resourceGroupName, frontDoorName, context) + .getValue(); + return this; + } + + public FrontDoorImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FrontDoorImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FrontDoorImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public FrontDoorImpl withFriendlyName(String friendlyName) { + this.innerModel().withFriendlyName(friendlyName); + return this; + } + + public FrontDoorImpl withRoutingRules(List routingRules) { + this.innerModel().withRoutingRules(routingRules); + return this; + } + + public FrontDoorImpl withLoadBalancingSettings(List loadBalancingSettings) { + this.innerModel().withLoadBalancingSettings(loadBalancingSettings); + return this; + } + + public FrontDoorImpl withHealthProbeSettings(List healthProbeSettings) { + this.innerModel().withHealthProbeSettings(healthProbeSettings); + return this; + } + + public FrontDoorImpl withBackendPools(List backendPools) { + this.innerModel().withBackendPools(backendPools); + return this; + } + + public FrontDoorImpl withFrontendEndpoints(List frontendEndpoints) { + this.innerModel().withFrontendEndpoints(frontendEndpoints); + return this; + } + + public FrontDoorImpl withBackendPoolsSettings(BackendPoolsSettings backendPoolsSettings) { + this.innerModel().withBackendPoolsSettings(backendPoolsSettings); + return this; + } + + public FrontDoorImpl withEnabledState(FrontDoorEnabledState enabledState) { + this.innerModel().withEnabledState(enabledState); + return this; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorManagementClientBuilder.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorManagementClientBuilder.java new file mode 100644 index 0000000000000..0eab2f36730b9 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorManagementClientBuilder.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.frontdoor.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the FrontDoorManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {FrontDoorManagementClientImpl.class}) +public final class FrontDoorManagementClientBuilder { + /* + * The subscription credentials which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the FrontDoorManagementClientBuilder. + */ + public FrontDoorManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the FrontDoorManagementClientBuilder. + */ + public FrontDoorManagementClientBuilder 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 FrontDoorManagementClientBuilder. + */ + public FrontDoorManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the FrontDoorManagementClientBuilder. + */ + public FrontDoorManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the FrontDoorManagementClientBuilder. + */ + public FrontDoorManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the FrontDoorManagementClientBuilder. + */ + public FrontDoorManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of FrontDoorManagementClientImpl with the provided parameters. + * + * @return an instance of FrontDoorManagementClientImpl. + */ + public FrontDoorManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + FrontDoorManagementClientImpl client = + new FrontDoorManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorManagementClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorManagementClientImpl.java new file mode 100644 index 0000000000000..01f865998c717 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorManagementClientImpl.java @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.frontdoor.fluent.EndpointsClient; +import com.azure.resourcemanager.frontdoor.fluent.ExperimentsClient; +import com.azure.resourcemanager.frontdoor.fluent.FrontDoorManagementClient; +import com.azure.resourcemanager.frontdoor.fluent.FrontDoorNameAvailabilitiesClient; +import com.azure.resourcemanager.frontdoor.fluent.FrontDoorNameAvailabilityWithSubscriptionsClient; +import com.azure.resourcemanager.frontdoor.fluent.FrontDoorsClient; +import com.azure.resourcemanager.frontdoor.fluent.FrontendEndpointsClient; +import com.azure.resourcemanager.frontdoor.fluent.ManagedRuleSetsClient; +import com.azure.resourcemanager.frontdoor.fluent.NetworkExperimentProfilesClient; +import com.azure.resourcemanager.frontdoor.fluent.PoliciesClient; +import com.azure.resourcemanager.frontdoor.fluent.PreconfiguredEndpointsClient; +import com.azure.resourcemanager.frontdoor.fluent.ReportsClient; +import com.azure.resourcemanager.frontdoor.fluent.RulesEnginesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the FrontDoorManagementClientImpl type. */ +@ServiceClient(builder = FrontDoorManagementClientBuilder.class) +public final class FrontDoorManagementClientImpl implements FrontDoorManagementClient { + private final ClientLogger logger = new ClientLogger(FrontDoorManagementClientImpl.class); + + /** + * The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @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; + } + + /** 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 NetworkExperimentProfilesClient object to access its operations. */ + private final NetworkExperimentProfilesClient networkExperimentProfiles; + + /** + * Gets the NetworkExperimentProfilesClient object to access its operations. + * + * @return the NetworkExperimentProfilesClient object. + */ + public NetworkExperimentProfilesClient getNetworkExperimentProfiles() { + return this.networkExperimentProfiles; + } + + /** The PreconfiguredEndpointsClient object to access its operations. */ + private final PreconfiguredEndpointsClient preconfiguredEndpoints; + + /** + * Gets the PreconfiguredEndpointsClient object to access its operations. + * + * @return the PreconfiguredEndpointsClient object. + */ + public PreconfiguredEndpointsClient getPreconfiguredEndpoints() { + return this.preconfiguredEndpoints; + } + + /** The ExperimentsClient object to access its operations. */ + private final ExperimentsClient experiments; + + /** + * Gets the ExperimentsClient object to access its operations. + * + * @return the ExperimentsClient object. + */ + public ExperimentsClient getExperiments() { + return this.experiments; + } + + /** The ReportsClient object to access its operations. */ + private final ReportsClient reports; + + /** + * Gets the ReportsClient object to access its operations. + * + * @return the ReportsClient object. + */ + public ReportsClient getReports() { + return this.reports; + } + + /** The FrontDoorNameAvailabilitiesClient object to access its operations. */ + private final FrontDoorNameAvailabilitiesClient frontDoorNameAvailabilities; + + /** + * Gets the FrontDoorNameAvailabilitiesClient object to access its operations. + * + * @return the FrontDoorNameAvailabilitiesClient object. + */ + public FrontDoorNameAvailabilitiesClient getFrontDoorNameAvailabilities() { + return this.frontDoorNameAvailabilities; + } + + /** The FrontDoorNameAvailabilityWithSubscriptionsClient object to access its operations. */ + private final FrontDoorNameAvailabilityWithSubscriptionsClient frontDoorNameAvailabilityWithSubscriptions; + + /** + * Gets the FrontDoorNameAvailabilityWithSubscriptionsClient object to access its operations. + * + * @return the FrontDoorNameAvailabilityWithSubscriptionsClient object. + */ + public FrontDoorNameAvailabilityWithSubscriptionsClient getFrontDoorNameAvailabilityWithSubscriptions() { + return this.frontDoorNameAvailabilityWithSubscriptions; + } + + /** The FrontDoorsClient object to access its operations. */ + private final FrontDoorsClient frontDoors; + + /** + * Gets the FrontDoorsClient object to access its operations. + * + * @return the FrontDoorsClient object. + */ + public FrontDoorsClient getFrontDoors() { + return this.frontDoors; + } + + /** The FrontendEndpointsClient object to access its operations. */ + private final FrontendEndpointsClient frontendEndpoints; + + /** + * Gets the FrontendEndpointsClient object to access its operations. + * + * @return the FrontendEndpointsClient object. + */ + public FrontendEndpointsClient getFrontendEndpoints() { + return this.frontendEndpoints; + } + + /** 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 RulesEnginesClient object to access its operations. */ + private final RulesEnginesClient rulesEngines; + + /** + * Gets the RulesEnginesClient object to access its operations. + * + * @return the RulesEnginesClient object. + */ + public RulesEnginesClient getRulesEngines() { + return this.rulesEngines; + } + + /** 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 FrontDoorManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The subscription credentials which uniquely identify the Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + FrontDoorManagementClientImpl( + 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.networkExperimentProfiles = new NetworkExperimentProfilesClientImpl(this); + this.preconfiguredEndpoints = new PreconfiguredEndpointsClientImpl(this); + this.experiments = new ExperimentsClientImpl(this); + this.reports = new ReportsClientImpl(this); + this.frontDoorNameAvailabilities = new FrontDoorNameAvailabilitiesClientImpl(this); + this.frontDoorNameAvailabilityWithSubscriptions = + new FrontDoorNameAvailabilityWithSubscriptionsClientImpl(this); + this.frontDoors = new FrontDoorsClientImpl(this); + this.frontendEndpoints = new FrontendEndpointsClientImpl(this); + this.endpoints = new EndpointsClientImpl(this); + this.rulesEngines = new RulesEnginesClientImpl(this); + this.policies = new PoliciesClientImpl(this); + this.managedRuleSets = new ManagedRuleSetsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilitiesClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilitiesClientImpl.java new file mode 100644 index 0000000000000..403c5ebc180df --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilitiesClientImpl.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.frontdoor.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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.FrontDoorNameAvailabilitiesClient; +import com.azure.resourcemanager.frontdoor.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityInput; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FrontDoorNameAvailabilitiesClient. */ +public final class FrontDoorNameAvailabilitiesClientImpl implements FrontDoorNameAvailabilitiesClient { + private final ClientLogger logger = new ClientLogger(FrontDoorNameAvailabilitiesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FrontDoorNameAvailabilitiesService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of FrontDoorNameAvailabilitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FrontDoorNameAvailabilitiesClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy + .create( + FrontDoorNameAvailabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientFrontDoorNameAvailabilities to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface FrontDoorNameAvailabilitiesService { + @Headers({"Content-Type: application/json"}) + @Post("/providers/Microsoft.Network/checkFrontDoorNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> check( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check the availability of a Front Door resource name. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkWithResponseAsync( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (checkFrontDoorNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkFrontDoorNameAvailabilityInput is required and cannot be null.")); + } else { + checkFrontDoorNameAvailabilityInput.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .check( + this.client.getEndpoint(), + apiVersion, + checkFrontDoorNameAvailabilityInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of a Front Door resource name. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkWithResponseAsync( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (checkFrontDoorNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkFrontDoorNameAvailabilityInput is required and cannot be null.")); + } else { + checkFrontDoorNameAvailabilityInput.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .check(this.client.getEndpoint(), apiVersion, checkFrontDoorNameAvailabilityInput, accept, context); + } + + /** + * Check the availability of a Front Door resource name. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkAsync( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput) { + return checkWithResponseAsync(checkFrontDoorNameAvailabilityInput) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check the availability of a Front Door resource name. + * + * @param checkFrontDoorNameAvailabilityInput 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 check(CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput) { + return checkAsync(checkFrontDoorNameAvailabilityInput).block(); + } + + /** + * Check the availability of a Front Door resource name. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkWithResponse( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, Context context) { + return checkWithResponseAsync(checkFrontDoorNameAvailabilityInput, context).block(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilitiesImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilitiesImpl.java new file mode 100644 index 0000000000000..53de1b63180fc --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilitiesImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.frontdoor.fluent.FrontDoorNameAvailabilitiesClient; +import com.azure.resourcemanager.frontdoor.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityOutput; +import com.azure.resourcemanager.frontdoor.models.FrontDoorNameAvailabilities; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FrontDoorNameAvailabilitiesImpl implements FrontDoorNameAvailabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontDoorNameAvailabilitiesImpl.class); + + private final FrontDoorNameAvailabilitiesClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public FrontDoorNameAvailabilitiesImpl( + FrontDoorNameAvailabilitiesClient innerClient, + com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameAvailabilityOutput check(CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = this.serviceClient().check(checkFrontDoorNameAvailabilityInput); + if (inner != null) { + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkWithResponse( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, Context context) { + Response inner = + this.serviceClient().checkWithResponse(checkFrontDoorNameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private FrontDoorNameAvailabilitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilityWithSubscriptionsClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilityWithSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..da3eaa334592d --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilityWithSubscriptionsClientImpl.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.FrontDoorNameAvailabilityWithSubscriptionsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityInput; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * FrontDoorNameAvailabilityWithSubscriptionsClient. + */ +public final class FrontDoorNameAvailabilityWithSubscriptionsClientImpl + implements FrontDoorNameAvailabilityWithSubscriptionsClient { + private final ClientLogger logger = new ClientLogger(FrontDoorNameAvailabilityWithSubscriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FrontDoorNameAvailabilityWithSubscriptionsService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of FrontDoorNameAvailabilityWithSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FrontDoorNameAvailabilityWithSubscriptionsClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy + .create( + FrontDoorNameAvailabilityWithSubscriptionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientFrontDoorNameAvailabilityWithSubscriptions + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface FrontDoorNameAvailabilityWithSubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Network/checkFrontDoorNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> check( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check the availability of a Front Door subdomain. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkWithResponseAsync( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput) { + 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 (checkFrontDoorNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkFrontDoorNameAvailabilityInput is required and cannot be null.")); + } else { + checkFrontDoorNameAvailabilityInput.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .check( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + checkFrontDoorNameAvailabilityInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of a Front Door subdomain. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkWithResponseAsync( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, 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 (checkFrontDoorNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkFrontDoorNameAvailabilityInput is required and cannot be null.")); + } else { + checkFrontDoorNameAvailabilityInput.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .check( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + checkFrontDoorNameAvailabilityInput, + accept, + context); + } + + /** + * Check the availability of a Front Door subdomain. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkAsync( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput) { + return checkWithResponseAsync(checkFrontDoorNameAvailabilityInput) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check the availability of a Front Door subdomain. + * + * @param checkFrontDoorNameAvailabilityInput 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 check(CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput) { + return checkAsync(checkFrontDoorNameAvailabilityInput).block(); + } + + /** + * Check the availability of a Front Door subdomain. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkWithResponse( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, Context context) { + return checkWithResponseAsync(checkFrontDoorNameAvailabilityInput, context).block(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilityWithSubscriptionsImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilityWithSubscriptionsImpl.java new file mode 100644 index 0000000000000..60441751a9598 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorNameAvailabilityWithSubscriptionsImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.frontdoor.fluent.FrontDoorNameAvailabilityWithSubscriptionsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.frontdoor.models.CheckNameAvailabilityOutput; +import com.azure.resourcemanager.frontdoor.models.FrontDoorNameAvailabilityWithSubscriptions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FrontDoorNameAvailabilityWithSubscriptionsImpl + implements FrontDoorNameAvailabilityWithSubscriptions { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(FrontDoorNameAvailabilityWithSubscriptionsImpl.class); + + private final FrontDoorNameAvailabilityWithSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public FrontDoorNameAvailabilityWithSubscriptionsImpl( + FrontDoorNameAvailabilityWithSubscriptionsClient innerClient, + com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameAvailabilityOutput check(CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = this.serviceClient().check(checkFrontDoorNameAvailabilityInput); + if (inner != null) { + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkWithResponse( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, Context context) { + Response inner = + this.serviceClient().checkWithResponse(checkFrontDoorNameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private FrontDoorNameAvailabilityWithSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorsClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorsClientImpl.java new file mode 100644 index 0000000000000..d1b3576b4d7a7 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorsClientImpl.java @@ -0,0 +1,1457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.frontdoor.fluent.FrontDoorsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontDoorInner; +import com.azure.resourcemanager.frontdoor.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.frontdoor.models.FrontDoorListResult; +import com.azure.resourcemanager.frontdoor.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 FrontDoorsClient. */ +public final class FrontDoorsClientImpl implements FrontDoorsClient { + private final ClientLogger logger = new ClientLogger(FrontDoorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FrontDoorsService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of FrontDoorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FrontDoorsClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy.create(FrontDoorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientFrontDoors to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface FrontDoorsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/frontDoors") + @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.Network/frontDoors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FrontDoorInner frontDoorParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/validateCustomDomain") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateCustomDomain( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @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> 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); + } + + /** + * Lists all of the Front Doors 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 Front Doors. + */ + @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 apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 Front Doors 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 Front Doors. + */ + @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 apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the Front Doors 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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the Front Doors 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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the Front Doors 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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the Front Doors 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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + @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 (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.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + 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 Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + @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 (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.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + @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 Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Front Door with the specified Front Door name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String frontDoorName) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Front Door with the specified Front Door name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String frontDoorName, 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + accept, + context); + } + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Front Door with the specified Front Door name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String frontDoorName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, frontDoorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Front Door with the specified Front Door name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FrontDoorInner getByResourceGroup(String resourceGroupName, String frontDoorName) { + return getByResourceGroupAsync(resourceGroupName, frontDoorName).block(); + } + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Front Door with the specified Front Door name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String frontDoorName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, frontDoorName, context).block(); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (frontDoorParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter frontDoorParameters is required and cannot be null.")); + } else { + frontDoorParameters.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + frontDoorParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters, 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (frontDoorParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter frontDoorParameters is required and cannot be null.")); + } else { + frontDoorParameters.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + frontDoorParameters, + accept, + context); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FrontDoorInner> beginCreateOrUpdateAsync( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, frontDoorName, frontDoorParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FrontDoorInner.class, FrontDoorInner.class, Context.NONE); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FrontDoorInner> beginCreateOrUpdateAsync( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, frontDoorName, frontDoorParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FrontDoorInner.class, FrontDoorInner.class, context); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FrontDoorInner> beginCreateOrUpdate( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, frontDoorName, frontDoorParameters).getSyncPoller(); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FrontDoorInner> beginCreateOrUpdate( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, frontDoorName, frontDoorParameters, context).getSyncPoller(); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, frontDoorName, frontDoorParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, frontDoorName, frontDoorParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FrontDoorInner createOrUpdate( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters) { + return createOrUpdateAsync(resourceGroupName, frontDoorName, frontDoorParameters).block(); + } + + /** + * Creates a new Front Door with a Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontDoorParameters Front Door properties needed to create a new Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return front Door represents a collection of backend endpoints to route traffic to along with rules that specify + * how traffic is sent there. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FrontDoorInner createOrUpdate( + String resourceGroupName, String frontDoorName, FrontDoorInner frontDoorParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, frontDoorName, frontDoorParameters, context).block(); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String frontDoorName) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String frontDoorName, 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + accept, + context); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String frontDoorName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, frontDoorName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String frontDoorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, frontDoorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String frontDoorName) { + return beginDeleteAsync(resourceGroupName, frontDoorName).getSyncPoller(); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String frontDoorName, Context context) { + return beginDeleteAsync(resourceGroupName, frontDoorName, context).getSyncPoller(); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String frontDoorName) { + return beginDeleteAsync(resourceGroupName, frontDoorName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String frontDoorName, Context context) { + return beginDeleteAsync(resourceGroupName, frontDoorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 frontDoorName) { + deleteAsync(resourceGroupName, frontDoorName).block(); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 frontDoorName, Context context) { + deleteAsync(resourceGroupName, frontDoorName, context).block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, String frontDoorName, ValidateCustomDomainInput customDomainProperties) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName 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 apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateCustomDomain( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + 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 Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, + String frontDoorName, + 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 (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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName 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 apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateCustomDomain( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + customDomainProperties, + accept, + context); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateCustomDomainAsync( + String resourceGroupName, String frontDoorName, ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponseAsync(resourceGroupName, frontDoorName, customDomainProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @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 frontDoorName, ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainAsync(resourceGroupName, frontDoorName, customDomainProperties).block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateCustomDomainWithResponse( + String resourceGroupName, + String frontDoorName, + ValidateCustomDomainInput customDomainProperties, + Context context) { + return validateCustomDomainWithResponseAsync(resourceGroupName, frontDoorName, customDomainProperties, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Front Doors. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Front Doors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Front Doors. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Front Doors. + */ + @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)); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorsImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorsImpl.java new file mode 100644 index 0000000000000..16a5027cb7c82 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontDoorsImpl.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.frontdoor.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.frontdoor.fluent.FrontDoorsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontDoorInner; +import com.azure.resourcemanager.frontdoor.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.frontdoor.models.FrontDoor; +import com.azure.resourcemanager.frontdoor.models.FrontDoors; +import com.azure.resourcemanager.frontdoor.models.ValidateCustomDomainInput; +import com.azure.resourcemanager.frontdoor.models.ValidateCustomDomainOutput; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FrontDoorsImpl implements FrontDoors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontDoorsImpl.class); + + private final FrontDoorsClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public FrontDoorsImpl( + FrontDoorsClient innerClient, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new FrontDoorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new FrontDoorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new FrontDoorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new FrontDoorImpl(inner1, this.manager())); + } + + public FrontDoor getByResourceGroup(String resourceGroupName, String frontDoorName) { + FrontDoorInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, frontDoorName); + if (inner != null) { + return new FrontDoorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String frontDoorName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, frontDoorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FrontDoorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String frontDoorName) { + this.serviceClient().delete(resourceGroupName, frontDoorName); + } + + public void delete(String resourceGroupName, String frontDoorName, Context context) { + this.serviceClient().delete(resourceGroupName, frontDoorName, context); + } + + public ValidateCustomDomainOutput validateCustomDomain( + String resourceGroupName, String frontDoorName, ValidateCustomDomainInput customDomainProperties) { + ValidateCustomDomainOutputInner inner = + this.serviceClient().validateCustomDomain(resourceGroupName, frontDoorName, customDomainProperties); + if (inner != null) { + return new ValidateCustomDomainOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateCustomDomainWithResponse( + String resourceGroupName, + String frontDoorName, + ValidateCustomDomainInput customDomainProperties, + Context context) { + Response inner = + this + .serviceClient() + .validateCustomDomainWithResponse(resourceGroupName, frontDoorName, customDomainProperties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ValidateCustomDomainOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FrontDoor getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String frontDoorName = Utils.getValueFromIdByName(id, "frontDoors"); + if (frontDoorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'frontDoors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, frontDoorName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String frontDoorName = Utils.getValueFromIdByName(id, "frontDoors"); + if (frontDoorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'frontDoors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, frontDoorName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String frontDoorName = Utils.getValueFromIdByName(id, "frontDoors"); + if (frontDoorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'frontDoors'.", id))); + } + this.delete(resourceGroupName, frontDoorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String frontDoorName = Utils.getValueFromIdByName(id, "frontDoors"); + if (frontDoorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'frontDoors'.", id))); + } + this.delete(resourceGroupName, frontDoorName, context); + } + + private FrontDoorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + public FrontDoorImpl define(String name) { + return new FrontDoorImpl(name, this.manager()); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointImpl.java new file mode 100644 index 0000000000000..a47b7ef6b3a95 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner; +import com.azure.resourcemanager.frontdoor.models.CustomHttpsConfiguration; +import com.azure.resourcemanager.frontdoor.models.CustomHttpsProvisioningState; +import com.azure.resourcemanager.frontdoor.models.CustomHttpsProvisioningSubstate; +import com.azure.resourcemanager.frontdoor.models.FrontDoorResourceState; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpoint; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.frontdoor.models.SessionAffinityEnabledState; + +public final class FrontendEndpointImpl implements FrontendEndpoint { + private FrontendEndpointInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + FrontendEndpointImpl( + FrontendEndpointInner innerObject, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public SessionAffinityEnabledState sessionAffinityEnabledState() { + return this.innerModel().sessionAffinityEnabledState(); + } + + public Integer sessionAffinityTtlSeconds() { + return this.innerModel().sessionAffinityTtlSeconds(); + } + + public FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.innerModel().webApplicationFirewallPolicyLink(); + } + + public FrontDoorResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public CustomHttpsProvisioningState customHttpsProvisioningState() { + return this.innerModel().customHttpsProvisioningState(); + } + + public CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate() { + return this.innerModel().customHttpsProvisioningSubstate(); + } + + public CustomHttpsConfiguration customHttpsConfiguration() { + return this.innerModel().customHttpsConfiguration(); + } + + public FrontendEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointsClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointsClientImpl.java new file mode 100644 index 0000000000000..1daad33e8c8d3 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointsClientImpl.java @@ -0,0 +1,1149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.frontdoor.fluent.FrontendEndpointsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner; +import com.azure.resourcemanager.frontdoor.models.CustomHttpsConfiguration; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpointsListResult; +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 FrontendEndpointsClient. */ +public final class FrontendEndpointsClientImpl implements FrontendEndpointsClient { + private final ClientLogger logger = new ClientLogger(FrontendEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FrontendEndpointsService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of FrontendEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FrontendEndpointsClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy.create(FrontendEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientFrontendEndpoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface FrontendEndpointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/frontendEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFrontDoor( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/frontendEndpoints/{frontendEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @PathParam("frontendEndpointName") String frontendEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/enableHttps") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableHttps( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @PathParam("frontendEndpointName") String frontendEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CustomHttpsConfiguration customHttpsConfiguration, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/disableHttps") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disableHttps( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @PathParam("frontendEndpointName") String frontendEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFrontDoorNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFrontDoorSinglePageAsync( + String resourceGroupName, String frontDoorName) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByFrontDoor( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + 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 frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFrontDoorSinglePageAsync( + String resourceGroupName, String frontDoorName, 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByFrontDoor( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFrontDoorAsync(String resourceGroupName, String frontDoorName) { + return new PagedFlux<>( + () -> listByFrontDoorSinglePageAsync(resourceGroupName, frontDoorName), + nextLink -> listByFrontDoorNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFrontDoorAsync( + String resourceGroupName, String frontDoorName, Context context) { + return new PagedFlux<>( + () -> listByFrontDoorSinglePageAsync(resourceGroupName, frontDoorName, context), + nextLink -> listByFrontDoorNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName) { + return new PagedIterable<>(listByFrontDoorAsync(resourceGroupName, frontDoorName)); + } + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFrontDoor( + String resourceGroupName, String frontDoorName, Context context) { + return new PagedIterable<>(listByFrontDoorAsync(resourceGroupName, frontDoorName, context)); + } + + /** + * Gets a Frontend endpoint with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Frontend endpoint with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String frontDoorName, String frontendEndpointName) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (frontendEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter frontendEndpointName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + frontendEndpointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Frontend endpoint with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Frontend endpoint with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String frontDoorName, String frontendEndpointName, 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (frontendEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter frontendEndpointName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + frontendEndpointName, + apiVersion, + accept, + context); + } + + /** + * Gets a Frontend endpoint with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Frontend endpoint with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String frontDoorName, String frontendEndpointName) { + return getWithResponseAsync(resourceGroupName, frontDoorName, frontendEndpointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Frontend endpoint with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Frontend endpoint with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FrontendEndpointInner get(String resourceGroupName, String frontDoorName, String frontendEndpointName) { + return getAsync(resourceGroupName, frontDoorName, frontendEndpointName).block(); + } + + /** + * Gets a Frontend endpoint with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Frontend endpoint with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context) { + return getWithResponseAsync(resourceGroupName, frontDoorName, frontendEndpointName, context).block(); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableHttpsWithResponseAsync( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (frontendEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter frontendEndpointName is required and cannot be null.")); + } + if (customHttpsConfiguration == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customHttpsConfiguration is required and cannot be null.")); + } else { + customHttpsConfiguration.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableHttps( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + frontendEndpointName, + apiVersion, + customHttpsConfiguration, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableHttpsWithResponseAsync( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration, + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (frontendEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter frontendEndpointName is required and cannot be null.")); + } + if (customHttpsConfiguration == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customHttpsConfiguration is required and cannot be null.")); + } else { + customHttpsConfiguration.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableHttps( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + frontendEndpointName, + apiVersion, + customHttpsConfiguration, + accept, + context); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginEnableHttpsAsync( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration) { + Mono>> mono = + enableHttpsWithResponseAsync( + resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginEnableHttpsAsync( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + enableHttpsWithResponseAsync( + resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginEnableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration) { + return beginEnableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration) + .getSyncPoller(); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginEnableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration, + Context context) { + return beginEnableHttpsAsync( + resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, context) + .getSyncPoller(); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableHttpsAsync( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration) { + return beginEnableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableHttpsAsync( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration, + Context context) { + return beginEnableHttpsAsync( + resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration) { + enableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration).block(); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration, + Context context) { + enableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, context) + .block(); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableHttpsWithResponseAsync( + String resourceGroupName, String frontDoorName, String frontendEndpointName) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (frontendEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter frontendEndpointName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disableHttps( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + frontendEndpointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableHttpsWithResponseAsync( + String resourceGroupName, String frontDoorName, String frontendEndpointName, 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (frontendEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter frontendEndpointName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disableHttps( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + frontendEndpointName, + apiVersion, + accept, + context); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDisableHttpsAsync( + String resourceGroupName, String frontDoorName, String frontendEndpointName) { + Mono>> mono = + disableHttpsWithResponseAsync(resourceGroupName, frontDoorName, frontendEndpointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDisableHttpsAsync( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disableHttpsWithResponseAsync(resourceGroupName, frontDoorName, frontendEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDisableHttps( + String resourceGroupName, String frontDoorName, String frontendEndpointName) { + return beginDisableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName).getSyncPoller(); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDisableHttps( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context) { + return beginDisableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName, context).getSyncPoller(); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableHttpsAsync(String resourceGroupName, String frontDoorName, String frontendEndpointName) { + return beginDisableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableHttpsAsync( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context) { + return beginDisableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disableHttps(String resourceGroupName, String frontDoorName, String frontendEndpointName) { + disableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName).block(); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disableHttps( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context) { + disableHttpsAsync(resourceGroupName, frontDoorName, frontendEndpointName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFrontDoorNextSinglePageAsync(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.listByFrontDoorNext(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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFrontDoorNextSinglePageAsync( + 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 + .listByFrontDoorNext(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/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointsImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointsImpl.java new file mode 100644 index 0000000000000..fed8740707155 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/FrontendEndpointsImpl.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.frontdoor.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.frontdoor.fluent.FrontendEndpointsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner; +import com.azure.resourcemanager.frontdoor.models.CustomHttpsConfiguration; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpoint; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpoints; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FrontendEndpointsImpl implements FrontendEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontendEndpointsImpl.class); + + private final FrontendEndpointsClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public FrontendEndpointsImpl( + FrontendEndpointsClient innerClient, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName) { + PagedIterable inner = + this.serviceClient().listByFrontDoor(resourceGroupName, frontDoorName); + return Utils.mapPage(inner, inner1 -> new FrontendEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByFrontDoor( + String resourceGroupName, String frontDoorName, Context context) { + PagedIterable inner = + this.serviceClient().listByFrontDoor(resourceGroupName, frontDoorName, context); + return Utils.mapPage(inner, inner1 -> new FrontendEndpointImpl(inner1, this.manager())); + } + + public FrontendEndpoint get(String resourceGroupName, String frontDoorName, String frontendEndpointName) { + FrontendEndpointInner inner = this.serviceClient().get(resourceGroupName, frontDoorName, frontendEndpointName); + if (inner != null) { + return new FrontendEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, frontDoorName, frontendEndpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FrontendEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void enableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration) { + this + .serviceClient() + .enableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration); + } + + public void enableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration, + Context context) { + this + .serviceClient() + .enableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, context); + } + + public void disableHttps(String resourceGroupName, String frontDoorName, String frontendEndpointName) { + this.serviceClient().disableHttps(resourceGroupName, frontDoorName, frontendEndpointName); + } + + public void disableHttps( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context) { + this.serviceClient().disableHttps(resourceGroupName, frontDoorName, frontendEndpointName, context); + } + + private FrontendEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/LatencyScorecardImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/LatencyScorecardImpl.java new file mode 100644 index 0000000000000..08436ae734a33 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/LatencyScorecardImpl.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.frontdoor.implementation; + +import com.azure.resourcemanager.frontdoor.fluent.models.LatencyScorecardInner; +import com.azure.resourcemanager.frontdoor.models.LatencyMetric; +import com.azure.resourcemanager.frontdoor.models.LatencyScorecard; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class LatencyScorecardImpl implements LatencyScorecard { + private LatencyScorecardInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + LatencyScorecardImpl( + LatencyScorecardInner innerObject, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String 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 idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String endpointA() { + return this.innerModel().endpointA(); + } + + public String endpointB() { + return this.innerModel().endpointB(); + } + + public OffsetDateTime startDateTimeUtc() { + return this.innerModel().startDateTimeUtc(); + } + + public OffsetDateTime endDateTimeUtc() { + return this.innerModel().endDateTimeUtc(); + } + + public String country() { + return this.innerModel().country(); + } + + public List latencyMetrics() { + List inner = this.innerModel().latencyMetrics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public LatencyScorecardInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetDefinitionImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetDefinitionImpl.java new file mode 100644 index 0000000000000..9e7bcf035d622 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetDefinitionImpl.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.resourcemanager.frontdoor.fluent.models.ManagedRuleSetDefinitionInner; +import com.azure.resourcemanager.frontdoor.models.ManagedRuleGroupDefinition; +import com.azure.resourcemanager.frontdoor.models.ManagedRuleSetDefinition; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ManagedRuleSetDefinitionImpl implements ManagedRuleSetDefinition { + private ManagedRuleSetDefinitionInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + ManagedRuleSetDefinitionImpl( + ManagedRuleSetDefinitionInner innerObject, + com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String 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 provisioningState() { + return this.innerModel().provisioningState(); + } + + public String ruleSetId() { + return this.innerModel().ruleSetId(); + } + + 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.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetsClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetsClientImpl.java new file mode 100644 index 0000000000000..33a99f8607c69 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetsClientImpl.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.ManagedRuleSetsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.ManagedRuleSetDefinitionInner; +import com.azure.resourcemanager.frontdoor.models.ManagedRuleSetDefinitionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedRuleSetsClient. */ +public final class ManagedRuleSetsClientImpl implements ManagedRuleSetsClient { + private final ClientLogger logger = new ClientLogger(ManagedRuleSetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedRuleSetsService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of ManagedRuleSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedRuleSetsClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy.create(ManagedRuleSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientManagedRuleSets to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface ManagedRuleSetsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network" + + "/FrontDoorWebApplicationFirewallManagedRuleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all available managed rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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. + */ + @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 apiVersion = "2020-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all available managed rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all available managed rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all available managed rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all available managed rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetsImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetsImpl.java new file mode 100644 index 0000000000000..5475a5c2899a4 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ManagedRuleSetsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.frontdoor.fluent.ManagedRuleSetsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.ManagedRuleSetDefinitionInner; +import com.azure.resourcemanager.frontdoor.models.ManagedRuleSetDefinition; +import com.azure.resourcemanager.frontdoor.models.ManagedRuleSets; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedRuleSetsImpl implements ManagedRuleSets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSetsImpl.class); + + private final ManagedRuleSetsClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public ManagedRuleSetsImpl( + ManagedRuleSetsClient innerClient, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ManagedRuleSetDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ManagedRuleSetDefinitionImpl(inner1, this.manager())); + } + + private ManagedRuleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/NetworkExperimentProfilesClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/NetworkExperimentProfilesClientImpl.java new file mode 100644 index 0000000000000..ad23689affd7b --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/NetworkExperimentProfilesClientImpl.java @@ -0,0 +1,1527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.frontdoor.fluent.NetworkExperimentProfilesClient; +import com.azure.resourcemanager.frontdoor.fluent.models.ProfileInner; +import com.azure.resourcemanager.frontdoor.models.ProfileList; +import com.azure.resourcemanager.frontdoor.models.ProfileUpdateModel; +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 NetworkExperimentProfilesClient. */ +public final class NetworkExperimentProfilesClientImpl implements NetworkExperimentProfilesClient { + private final ClientLogger logger = new ClientLogger(NetworkExperimentProfilesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkExperimentProfilesService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of NetworkExperimentProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkExperimentProfilesClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkExperimentProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientNetworkExperimentProfiles to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface NetworkExperimentProfilesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/NetworkExperimentProfiles") + @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.Network" + + "/NetworkExperimentProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @BodyParam("application/json") ProfileInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @BodyParam("application/json") ProfileUpdateModel parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @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); + } + + /** + * Gets a list of Network Experiment Profiles under a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Network Experiment Profiles under a subscription. + */ + @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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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())); + } + + /** + * Gets a list of Network Experiment Profiles under a 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 a list of Network Experiment Profiles under a subscription. + */ + @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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Network Experiment Profiles under a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Network Experiment Profiles under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Network Experiment Profiles under a 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 a list of Network Experiment Profiles under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Network Experiment Profiles under a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Network Experiment Profiles under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of Network Experiment Profiles under a 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 a list of Network Experiment Profiles under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + @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 (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.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + 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())); + } + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + @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 (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.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an NetworkExperiment Profile by ProfileName. + */ + @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 (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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an NetworkExperiment Profile by ProfileName. + */ + @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 (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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + accept, + context); + } + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an NetworkExperiment Profile by ProfileName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String profileName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, profileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an NetworkExperiment Profile by ProfileName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner getByResourceGroup(String resourceGroupName, String profileName) { + return getByResourceGroupAsync(resourceGroupName, profileName).block(); + } + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an NetworkExperiment Profile by ProfileName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String profileName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String profileName, String resourceGroupName, ProfileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + profileName, + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String profileName, String resourceGroupName, ProfileInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + profileName, + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + parameters, + accept, + context); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ProfileInner> beginCreateOrUpdateAsync( + String profileName, String resourceGroupName, ProfileInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(profileName, resourceGroupName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, Context.NONE); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ProfileInner> beginCreateOrUpdateAsync( + String profileName, String resourceGroupName, ProfileInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(profileName, resourceGroupName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, context); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProfileInner> beginCreateOrUpdate( + String profileName, String resourceGroupName, ProfileInner parameters) { + return beginCreateOrUpdateAsync(profileName, resourceGroupName, parameters).getSyncPoller(); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProfileInner> beginCreateOrUpdate( + String profileName, String resourceGroupName, ProfileInner parameters, Context context) { + return beginCreateOrUpdateAsync(profileName, resourceGroupName, parameters, context).getSyncPoller(); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String profileName, String resourceGroupName, ProfileInner parameters) { + return beginCreateOrUpdateAsync(profileName, resourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String profileName, String resourceGroupName, ProfileInner parameters, Context context) { + return beginCreateOrUpdateAsync(profileName, resourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner createOrUpdate(String profileName, String resourceGroupName, ProfileInner parameters) { + return createOrUpdateAsync(profileName, resourceGroupName, parameters).block(); + } + + /** + * Creates an NetworkExperiment Profile. + * + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param parameters An Network Experiment 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 defines an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner createOrUpdate( + String profileName, String resourceGroupName, ProfileInner parameters, Context context) { + return createOrUpdateAsync(profileName, resourceGroupName, parameters, context).block(); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String profileName, ProfileUpdateModel parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String profileName, ProfileUpdateModel parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + parameters, + accept, + context); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ProfileInner> beginUpdateAsync( + String resourceGroupName, String profileName, ProfileUpdateModel parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, profileName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, Context.NONE); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ProfileInner> beginUpdateAsync( + String resourceGroupName, String profileName, ProfileUpdateModel parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, context); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateModel parameters) { + return beginUpdateAsync(resourceGroupName, profileName, parameters).getSyncPoller(); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateModel parameters, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, parameters, context).getSyncPoller(); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String profileName, ProfileUpdateModel parameters) { + return beginUpdateAsync(resourceGroupName, profileName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String profileName, ProfileUpdateModel parameters, Context context) { + return beginUpdateAsync(resourceGroupName, profileName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner update(String resourceGroupName, String profileName, ProfileUpdateModel parameters) { + return updateAsync(resourceGroupName, profileName, parameters).block(); + } + + /** + * Updates an NetworkExperimentProfiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param parameters The Profile Update Model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an Network Experiment Profile and lists of Experiments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner update( + String resourceGroupName, String profileName, ProfileUpdateModel parameters, Context context) { + return updateAsync(resourceGroupName, profileName, parameters, context).block(); + } + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + accept, + context); + } + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String profileName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName) { + return beginDeleteAsync(resourceGroupName, profileName).getSyncPoller(); + } + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String profileName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, context).getSyncPoller(); + } + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName) { + return beginDeleteAsync(resourceGroupName, profileName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of Profiles. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of Profiles. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of Profiles. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of Profiles. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/NetworkExperimentProfilesImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/NetworkExperimentProfilesImpl.java new file mode 100644 index 0000000000000..c9970f7750faf --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/NetworkExperimentProfilesImpl.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.frontdoor.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.frontdoor.fluent.NetworkExperimentProfilesClient; +import com.azure.resourcemanager.frontdoor.fluent.models.ProfileInner; +import com.azure.resourcemanager.frontdoor.models.NetworkExperimentProfiles; +import com.azure.resourcemanager.frontdoor.models.Profile; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkExperimentProfilesImpl implements NetworkExperimentProfiles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkExperimentProfilesImpl.class); + + private final NetworkExperimentProfilesClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public NetworkExperimentProfilesImpl( + NetworkExperimentProfilesClient innerClient, + com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public Profile getByResourceGroup(String resourceGroupName, String profileName) { + ProfileInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, profileName); + if (inner != null) { + return new ProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String profileName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String profileName) { + this.serviceClient().delete(resourceGroupName, profileName); + } + + public void delete(String resourceGroupName, String profileName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, context); + } + + public Profile getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "NetworkExperimentProfiles"); + if (profileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'NetworkExperimentProfiles'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "NetworkExperimentProfiles"); + if (profileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'NetworkExperimentProfiles'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, profileName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "NetworkExperimentProfiles"); + if (profileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'NetworkExperimentProfiles'.", + id))); + } + this.delete(resourceGroupName, profileName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "NetworkExperimentProfiles"); + if (profileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'NetworkExperimentProfiles'.", + id))); + } + this.delete(resourceGroupName, profileName, context); + } + + private NetworkExperimentProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + public ProfileImpl define(String name) { + return new ProfileImpl(name, this.manager()); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PoliciesClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PoliciesClientImpl.java new file mode 100644 index 0000000000000..ed1d424fc8173 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PoliciesClientImpl.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.frontdoor.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.frontdoor.fluent.PoliciesClient; +import com.azure.resourcemanager.frontdoor.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.frontdoor.models.WebApplicationFirewallPolicyList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PoliciesClient. */ +public final class PoliciesClientImpl implements PoliciesClient { + private final ClientLogger logger = new ClientLogger(PoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PoliciesService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of PoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PoliciesClientImpl(FrontDoorManagementClientImpl client) { + this.service = RestProxy.create(PoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientPolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface PoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/frontDoorWebApplicationFirewallPolicies") + @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.Network" + + "/FrontDoorWebApplicationFirewallPolicies/{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.Network" + + "/FrontDoorWebApplicationFirewallPolicies/{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") WebApplicationFirewallPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/FrontDoorWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies. + */ + @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 apiVersion = "2020-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + 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. + */ + @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 apiVersion = "2020-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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 apiVersion = "2020-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + 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 Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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 apiVersion = "2020-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + 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 Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String policyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName) { + return getByResourceGroupAsync(resourceGroupName, policyName).block(); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName, context).block(); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + 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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + 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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WebApplicationFirewallPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, policyName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WebApplicationFirewallPolicyInner.class, + WebApplicationFirewallPolicyInner.class, + Context.NONE); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WebApplicationFirewallPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String policyName, + WebApplicationFirewallPolicyInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, policyName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WebApplicationFirewallPolicyInner.class, + WebApplicationFirewallPolicyInner.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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WebApplicationFirewallPolicyInner> + beginCreateOrUpdate(String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, parameters).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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WebApplicationFirewallPolicyInner> + beginCreateOrUpdate( + String resourceGroupName, + String policyName, + WebApplicationFirewallPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, parameters, 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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, parameters) + .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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, parameters, 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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, policyName, parameters).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 Web Application Firewall Policy. + * @param parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, policyName, parameters, context).block(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String policyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-11-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + 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 Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String policyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-11-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + context); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String policyName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, policyName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String policyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, policyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String policyName) { + return beginDeleteAsync(resourceGroupName, policyName).getSyncPoller(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String policyName, Context context) { + return beginDeleteAsync(resourceGroupName, policyName, context).getSyncPoller(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String policyName) { + return beginDeleteAsync(resourceGroupName, policyName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String policyName, Context context) { + return beginDeleteAsync(resourceGroupName, policyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String policyName) { + deleteAsync(resourceGroupName, policyName).block(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, Context context) { + deleteAsync(resourceGroupName, policyName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies. + */ + @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/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PoliciesImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PoliciesImpl.java new file mode 100644 index 0000000000000..c2f9a364d66d3 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PoliciesImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.frontdoor.fluent.PoliciesClient; +import com.azure.resourcemanager.frontdoor.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.frontdoor.models.Policies; +import com.azure.resourcemanager.frontdoor.models.WebApplicationFirewallPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PoliciesImpl implements Policies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PoliciesImpl.class); + + private final PoliciesClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public PoliciesImpl( + PoliciesClient innerClient, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public WebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName) { + WebApplicationFirewallPolicyInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, policyName); + if (inner != null) { + return new WebApplicationFirewallPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, policyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WebApplicationFirewallPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String policyName) { + this.serviceClient().delete(resourceGroupName, policyName); + } + + public void delete(String resourceGroupName, String policyName, Context context) { + this.serviceClient().delete(resourceGroupName, policyName, context); + } + + public WebApplicationFirewallPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "FrontDoorWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'FrontDoorWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "FrontDoorWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'FrontDoorWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "FrontDoorWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'FrontDoorWebApplicationFirewallPolicies'.", + id))); + } + this.delete(resourceGroupName, policyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "FrontDoorWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'FrontDoorWebApplicationFirewallPolicies'.", + id))); + } + this.delete(resourceGroupName, policyName, context); + } + + private PoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + public WebApplicationFirewallPolicyImpl define(String name) { + return new WebApplicationFirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointImpl.java new file mode 100644 index 0000000000000..ffe3945439865 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.resourcemanager.frontdoor.fluent.models.PreconfiguredEndpointInner; +import com.azure.resourcemanager.frontdoor.models.EndpointType; +import com.azure.resourcemanager.frontdoor.models.PreconfiguredEndpoint; +import java.util.Collections; +import java.util.Map; + +public final class PreconfiguredEndpointImpl implements PreconfiguredEndpoint { + private PreconfiguredEndpointInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + PreconfiguredEndpointImpl( + PreconfiguredEndpointInner innerObject, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String 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 description() { + return this.innerModel().description(); + } + + public String endpoint() { + return this.innerModel().endpoint(); + } + + public EndpointType endpointType() { + return this.innerModel().endpointType(); + } + + public String backend() { + return this.innerModel().backend(); + } + + public PreconfiguredEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointsClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointsClientImpl.java new file mode 100644 index 0000000000000..a859d6ec0f585 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointsClientImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.PreconfiguredEndpointsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.PreconfiguredEndpointInner; +import com.azure.resourcemanager.frontdoor.models.PreconfiguredEndpointList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PreconfiguredEndpointsClient. */ +public final class PreconfiguredEndpointsClientImpl implements PreconfiguredEndpointsClient { + private final ClientLogger logger = new ClientLogger(PreconfiguredEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PreconfiguredEndpointsService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of PreconfiguredEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PreconfiguredEndpointsClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy + .create(PreconfiguredEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientPreconfiguredEndpoints to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface PreconfiguredEndpointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}/PreconfiguredEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @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); + } + + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Preconfigured Endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + 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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + 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())); + } + + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Preconfigured Endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + 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 apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Preconfigured Endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, profileName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Preconfigured Endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Preconfigured Endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String profileName) { + return new PagedIterable<>(listAsync(resourceGroupName, profileName)); + } + + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of Preconfigured Endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, profileName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of preconfigured endpoints. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of preconfigured endpoints. + */ + @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/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointsImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointsImpl.java new file mode 100644 index 0000000000000..877cb567e4bc2 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/PreconfiguredEndpointsImpl.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.frontdoor.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.frontdoor.fluent.PreconfiguredEndpointsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.PreconfiguredEndpointInner; +import com.azure.resourcemanager.frontdoor.models.PreconfiguredEndpoint; +import com.azure.resourcemanager.frontdoor.models.PreconfiguredEndpoints; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PreconfiguredEndpointsImpl implements PreconfiguredEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PreconfiguredEndpointsImpl.class); + + private final PreconfiguredEndpointsClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public PreconfiguredEndpointsImpl( + PreconfiguredEndpointsClient innerClient, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new PreconfiguredEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new PreconfiguredEndpointImpl(inner1, this.manager())); + } + + private PreconfiguredEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ProfileImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ProfileImpl.java new file mode 100644 index 0000000000000..eb483d1841c50 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ProfileImpl.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.frontdoor.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.fluent.models.ProfileInner; +import com.azure.resourcemanager.frontdoor.models.NetworkExperimentResourceState; +import com.azure.resourcemanager.frontdoor.models.Profile; +import com.azure.resourcemanager.frontdoor.models.ProfileUpdateModel; +import com.azure.resourcemanager.frontdoor.models.State; +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.frontdoor.FrontDoorManager 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 NetworkExperimentResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public State enabledState() { + return this.innerModel().enabledState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + private String profileName; + + private String resourceGroupName; + + private ProfileUpdateModel updateParameters; + + public ProfileImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Profile create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkExperimentProfiles() + .createOrUpdate(profileName, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public Profile create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkExperimentProfiles() + .createOrUpdate(profileName, resourceGroupName, this.innerModel(), context); + return this; + } + + ProfileImpl(String name, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = new ProfileInner(); + this.serviceManager = serviceManager; + this.profileName = name; + } + + public ProfileImpl update() { + this.updateParameters = new ProfileUpdateModel(); + return this; + } + + public Profile apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkExperimentProfiles() + .update(resourceGroupName, profileName, updateParameters, Context.NONE); + return this; + } + + public Profile apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkExperimentProfiles() + .update(resourceGroupName, profileName, updateParameters, context); + return this; + } + + ProfileImpl(ProfileInner innerObject, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "NetworkExperimentProfiles"); + } + + public Profile refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkExperimentProfiles() + .getByResourceGroupWithResponse(resourceGroupName, profileName, Context.NONE) + .getValue(); + return this; + } + + public Profile refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkExperimentProfiles() + .getByResourceGroupWithResponse(resourceGroupName, profileName, context) + .getValue(); + return this; + } + + 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 withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ProfileImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public ProfileImpl withEnabledState(State enabledState) { + if (isInCreateMode()) { + this.innerModel().withEnabledState(enabledState); + return this; + } else { + this.updateParameters.withEnabledState(enabledState); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ReportsClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ReportsClientImpl.java new file mode 100644 index 0000000000000..30c44bc74788a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ReportsClientImpl.java @@ -0,0 +1,719 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.ReportsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.LatencyScorecardInner; +import com.azure.resourcemanager.frontdoor.fluent.models.TimeseriesInner; +import com.azure.resourcemanager.frontdoor.models.LatencyScorecardAggregationInterval; +import com.azure.resourcemanager.frontdoor.models.TimeseriesAggregationInterval; +import com.azure.resourcemanager.frontdoor.models.TimeseriesType; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReportsClient. */ +public final class ReportsClientImpl implements ReportsClient { + private final ClientLogger logger = new ClientLogger(ReportsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ReportsService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of ReportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReportsClientImpl(FrontDoorManagementClientImpl client) { + this.service = RestProxy.create(ReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientReports to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface ReportsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/LatencyScorecard") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLatencyScorecards( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("experimentName") String experimentName, + @QueryParam("endDateTimeUTC") String endDateTimeUtc, + @QueryParam("country") String country, + @QueryParam("aggregationInterval") LatencyScorecardAggregationInterval aggregationInterval, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/Timeseries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getTimeseries( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("experimentName") String experimentName, + @QueryParam("startDateTimeUTC") OffsetDateTime startDateTimeUtc, + @QueryParam("endDateTimeUTC") OffsetDateTime endDateTimeUtc, + @QueryParam("aggregationInterval") TimeseriesAggregationInterval aggregationInterval, + @QueryParam("timeseriesType") TimeseriesType timeseriesType, + @QueryParam("endpoint") String endpointParam, + @QueryParam("country") String country, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @param endDateTimeUtc The end DateTime of the Latency Scorecard in UTC. + * @param country The country associated with the Latency Scorecard. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Latency Scorecard for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLatencyScorecardsWithResponseAsync( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval, + String endDateTimeUtc, + String country) { + 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + if (aggregationInterval == null) { + return Mono + .error(new IllegalArgumentException("Parameter aggregationInterval is required and cannot be null.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLatencyScorecards( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + endDateTimeUtc, + country, + aggregationInterval, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @param endDateTimeUtc The end DateTime of the Latency Scorecard in UTC. + * @param country The country associated with the Latency Scorecard. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Latency Scorecard for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLatencyScorecardsWithResponseAsync( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval, + String endDateTimeUtc, + String country, + 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + if (aggregationInterval == null) { + return Mono + .error(new IllegalArgumentException("Parameter aggregationInterval is required and cannot be null.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLatencyScorecards( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + endDateTimeUtc, + country, + aggregationInterval, + accept, + context); + } + + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @param endDateTimeUtc The end DateTime of the Latency Scorecard in UTC. + * @param country The country associated with the Latency Scorecard. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Latency Scorecard for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLatencyScorecardsAsync( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval, + String endDateTimeUtc, + String country) { + return getLatencyScorecardsWithResponseAsync( + resourceGroupName, profileName, experimentName, aggregationInterval, endDateTimeUtc, country) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Latency Scorecard for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLatencyScorecardsAsync( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval) { + final String endDateTimeUtc = null; + final String country = null; + return getLatencyScorecardsWithResponseAsync( + resourceGroupName, profileName, experimentName, aggregationInterval, endDateTimeUtc, country) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Latency Scorecard for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LatencyScorecardInner getLatencyScorecards( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval) { + final String endDateTimeUtc = null; + final String country = null; + return getLatencyScorecardsAsync( + resourceGroupName, profileName, experimentName, aggregationInterval, endDateTimeUtc, country) + .block(); + } + + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @param endDateTimeUtc The end DateTime of the Latency Scorecard in UTC. + * @param country The country associated with the Latency Scorecard. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Latency Scorecard for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLatencyScorecardsWithResponse( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval, + String endDateTimeUtc, + String country, + Context context) { + return getLatencyScorecardsWithResponseAsync( + resourceGroupName, profileName, experimentName, aggregationInterval, endDateTimeUtc, country, context) + .block(); + } + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @param endpoint The specific endpoint. + * @param country The country associated with the Timeseries. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Timeseries for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getTimeseriesWithResponseAsync( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType, + String endpoint, + String country) { + 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + if (startDateTimeUtc == null) { + return Mono + .error(new IllegalArgumentException("Parameter startDateTimeUtc is required and cannot be null.")); + } + if (endDateTimeUtc == null) { + return Mono.error(new IllegalArgumentException("Parameter endDateTimeUtc is required and cannot be null.")); + } + if (aggregationInterval == null) { + return Mono + .error(new IllegalArgumentException("Parameter aggregationInterval is required and cannot be null.")); + } + if (timeseriesType == null) { + return Mono.error(new IllegalArgumentException("Parameter timeseriesType is required and cannot be null.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getTimeseries( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + startDateTimeUtc, + endDateTimeUtc, + aggregationInterval, + timeseriesType, + endpoint, + country, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @param endpoint The specific endpoint. + * @param country The country associated with the Timeseries. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Timeseries for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getTimeseriesWithResponseAsync( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType, + String endpoint, + String country, + 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + if (startDateTimeUtc == null) { + return Mono + .error(new IllegalArgumentException("Parameter startDateTimeUtc is required and cannot be null.")); + } + if (endDateTimeUtc == null) { + return Mono.error(new IllegalArgumentException("Parameter endDateTimeUtc is required and cannot be null.")); + } + if (aggregationInterval == null) { + return Mono + .error(new IllegalArgumentException("Parameter aggregationInterval is required and cannot be null.")); + } + if (timeseriesType == null) { + return Mono.error(new IllegalArgumentException("Parameter timeseriesType is required and cannot be null.")); + } + final String apiVersion = "2019-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getTimeseries( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + profileName, + experimentName, + startDateTimeUtc, + endDateTimeUtc, + aggregationInterval, + timeseriesType, + endpoint, + country, + accept, + context); + } + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @param endpoint The specific endpoint. + * @param country The country associated with the Timeseries. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Timeseries for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getTimeseriesAsync( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType, + String endpoint, + String country) { + return getTimeseriesWithResponseAsync( + resourceGroupName, + profileName, + experimentName, + startDateTimeUtc, + endDateTimeUtc, + aggregationInterval, + timeseriesType, + endpoint, + country) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Timeseries for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getTimeseriesAsync( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType) { + final String endpoint = null; + final String country = null; + return getTimeseriesWithResponseAsync( + resourceGroupName, + profileName, + experimentName, + startDateTimeUtc, + endDateTimeUtc, + aggregationInterval, + timeseriesType, + endpoint, + country) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Timeseries for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TimeseriesInner getTimeseries( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType) { + final String endpoint = null; + final String country = null; + return getTimeseriesAsync( + resourceGroupName, + profileName, + experimentName, + startDateTimeUtc, + endDateTimeUtc, + aggregationInterval, + timeseriesType, + endpoint, + country) + .block(); + } + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @param endpoint The specific endpoint. + * @param country The country associated with the Timeseries. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Timeseries for a given Experiment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTimeseriesWithResponse( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType, + String endpoint, + String country, + Context context) { + return getTimeseriesWithResponseAsync( + resourceGroupName, + profileName, + experimentName, + startDateTimeUtc, + endDateTimeUtc, + aggregationInterval, + timeseriesType, + endpoint, + country, + context) + .block(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ReportsImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ReportsImpl.java new file mode 100644 index 0000000000000..097bac886c778 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ReportsImpl.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.frontdoor.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.frontdoor.fluent.ReportsClient; +import com.azure.resourcemanager.frontdoor.fluent.models.LatencyScorecardInner; +import com.azure.resourcemanager.frontdoor.fluent.models.TimeseriesInner; +import com.azure.resourcemanager.frontdoor.models.LatencyScorecard; +import com.azure.resourcemanager.frontdoor.models.LatencyScorecardAggregationInterval; +import com.azure.resourcemanager.frontdoor.models.Reports; +import com.azure.resourcemanager.frontdoor.models.Timeseries; +import com.azure.resourcemanager.frontdoor.models.TimeseriesAggregationInterval; +import com.azure.resourcemanager.frontdoor.models.TimeseriesType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.OffsetDateTime; + +public final class ReportsImpl implements Reports { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReportsImpl.class); + + private final ReportsClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public ReportsImpl(ReportsClient innerClient, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public LatencyScorecard getLatencyScorecards( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval) { + LatencyScorecardInner inner = + this + .serviceClient() + .getLatencyScorecards(resourceGroupName, profileName, experimentName, aggregationInterval); + if (inner != null) { + return new LatencyScorecardImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLatencyScorecardsWithResponse( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval, + String endDateTimeUtc, + String country, + Context context) { + Response inner = + this + .serviceClient() + .getLatencyScorecardsWithResponse( + resourceGroupName, + profileName, + experimentName, + aggregationInterval, + endDateTimeUtc, + country, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LatencyScorecardImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Timeseries getTimeseries( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType) { + TimeseriesInner inner = + this + .serviceClient() + .getTimeseries( + resourceGroupName, + profileName, + experimentName, + startDateTimeUtc, + endDateTimeUtc, + aggregationInterval, + timeseriesType); + if (inner != null) { + return new TimeseriesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getTimeseriesWithResponse( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType, + String endpoint, + String country, + Context context) { + Response inner = + this + .serviceClient() + .getTimeseriesWithResponse( + resourceGroupName, + profileName, + experimentName, + startDateTimeUtc, + endDateTimeUtc, + aggregationInterval, + timeseriesType, + endpoint, + country, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TimeseriesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ReportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEngineImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEngineImpl.java new file mode 100644 index 0000000000000..680514f509b34 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEngineImpl.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.frontdoor.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner; +import com.azure.resourcemanager.frontdoor.models.FrontDoorResourceState; +import com.azure.resourcemanager.frontdoor.models.RulesEngine; +import com.azure.resourcemanager.frontdoor.models.RulesEngineRule; +import java.util.Collections; +import java.util.List; + +public final class RulesEngineImpl implements RulesEngine, RulesEngine.Definition, RulesEngine.Update { + private RulesEngineInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List rules() { + List inner = this.innerModel().rules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public FrontDoorResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public RulesEngineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String frontDoorName; + + private String rulesEngineName; + + public RulesEngineImpl withExistingFrontDoor(String resourceGroupName, String frontDoorName) { + this.resourceGroupName = resourceGroupName; + this.frontDoorName = frontDoorName; + return this; + } + + public RulesEngine create() { + this.innerObject = + serviceManager + .serviceClient() + .getRulesEngines() + .createOrUpdate(resourceGroupName, frontDoorName, rulesEngineName, this.innerModel(), Context.NONE); + return this; + } + + public RulesEngine create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRulesEngines() + .createOrUpdate(resourceGroupName, frontDoorName, rulesEngineName, this.innerModel(), context); + return this; + } + + RulesEngineImpl(String name, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = new RulesEngineInner(); + this.serviceManager = serviceManager; + this.rulesEngineName = name; + } + + public RulesEngineImpl update() { + return this; + } + + public RulesEngine apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRulesEngines() + .createOrUpdate(resourceGroupName, frontDoorName, rulesEngineName, this.innerModel(), Context.NONE); + return this; + } + + public RulesEngine apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRulesEngines() + .createOrUpdate(resourceGroupName, frontDoorName, rulesEngineName, this.innerModel(), context); + return this; + } + + RulesEngineImpl(RulesEngineInner innerObject, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.frontDoorName = Utils.getValueFromIdByName(innerObject.id(), "frontDoors"); + this.rulesEngineName = Utils.getValueFromIdByName(innerObject.id(), "rulesEngines"); + } + + public RulesEngine refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRulesEngines() + .getWithResponse(resourceGroupName, frontDoorName, rulesEngineName, Context.NONE) + .getValue(); + return this; + } + + public RulesEngine refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRulesEngines() + .getWithResponse(resourceGroupName, frontDoorName, rulesEngineName, context) + .getValue(); + return this; + } + + public RulesEngineImpl withRules(List rules) { + this.innerModel().withRules(rules); + return this; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEnginesClientImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEnginesClientImpl.java new file mode 100644 index 0000000000000..27fe5b1c14620 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEnginesClientImpl.java @@ -0,0 +1,1167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.frontdoor.fluent.RulesEnginesClient; +import com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner; +import com.azure.resourcemanager.frontdoor.models.RulesEngineListResult; +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 RulesEnginesClient. */ +public final class RulesEnginesClientImpl implements RulesEnginesClient { + private final ClientLogger logger = new ClientLogger(RulesEnginesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RulesEnginesService service; + + /** The service client containing this operation class. */ + private final FrontDoorManagementClientImpl client; + + /** + * Initializes an instance of RulesEnginesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RulesEnginesClientImpl(FrontDoorManagementClientImpl client) { + this.service = + RestProxy.create(RulesEnginesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FrontDoorManagementClientRulesEngines to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "FrontDoorManagementC") + private interface RulesEnginesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/rulesEngines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFrontDoor( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/rulesEngines/{rulesEngineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @PathParam("rulesEngineName") String rulesEngineName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/rulesEngines/{rulesEngineName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @PathParam("rulesEngineName") String rulesEngineName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RulesEngineInner rulesEngineParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors" + + "/{frontDoorName}/rulesEngines/{rulesEngineName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("frontDoorName") String frontDoorName, + @PathParam("rulesEngineName") String rulesEngineName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFrontDoorNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFrontDoorSinglePageAsync( + String resourceGroupName, String frontDoorName) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByFrontDoor( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + 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 Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFrontDoorSinglePageAsync( + String resourceGroupName, String frontDoorName, 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByFrontDoor( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFrontDoorAsync(String resourceGroupName, String frontDoorName) { + return new PagedFlux<>( + () -> listByFrontDoorSinglePageAsync(resourceGroupName, frontDoorName), + nextLink -> listByFrontDoorNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFrontDoorAsync( + String resourceGroupName, String frontDoorName, Context context) { + return new PagedFlux<>( + () -> listByFrontDoorSinglePageAsync(resourceGroupName, frontDoorName, context), + nextLink -> listByFrontDoorNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName) { + return new PagedIterable<>(listByFrontDoorAsync(resourceGroupName, frontDoorName)); + } + + /** + * Lists all of the Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFrontDoor( + String resourceGroupName, String frontDoorName, Context context) { + return new PagedIterable<>(listByFrontDoorAsync(resourceGroupName, frontDoorName, context)); + } + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rules Engine Configuration with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String frontDoorName, String rulesEngineName) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (rulesEngineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter rulesEngineName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + rulesEngineName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rules Engine Configuration with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String frontDoorName, String rulesEngineName, 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (rulesEngineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter rulesEngineName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + rulesEngineName, + apiVersion, + accept, + context); + } + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rules Engine Configuration with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String frontDoorName, String rulesEngineName) { + return getWithResponseAsync(resourceGroupName, frontDoorName, rulesEngineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rules Engine Configuration with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RulesEngineInner get(String resourceGroupName, String frontDoorName, String rulesEngineName) { + return getAsync(resourceGroupName, frontDoorName, rulesEngineName).block(); + } + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rules Engine Configuration with the specified name within the specified Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String frontDoorName, String rulesEngineName, Context context) { + return getWithResponseAsync(resourceGroupName, frontDoorName, rulesEngineName, context).block(); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (rulesEngineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter rulesEngineName is required and cannot be null.")); + } + if (rulesEngineParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter rulesEngineParameters is required and cannot be null.")); + } else { + rulesEngineParameters.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + rulesEngineName, + apiVersion, + rulesEngineParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters, + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (rulesEngineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter rulesEngineName is required and cannot be null.")); + } + if (rulesEngineParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter rulesEngineParameters is required and cannot be null.")); + } else { + rulesEngineParameters.validate(); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + rulesEngineName, + apiVersion, + rulesEngineParameters, + accept, + context); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RulesEngineInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RulesEngineInner.class, RulesEngineInner.class, Context.NONE); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RulesEngineInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RulesEngineInner.class, RulesEngineInner.class, context); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RulesEngineInner> beginCreateOrUpdate( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters) + .getSyncPoller(); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RulesEngineInner> beginCreateOrUpdate( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters, context) + .getSyncPoller(); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RulesEngineInner createOrUpdate( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters) { + return createOrUpdateAsync(resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters).block(); + } + + /** + * Creates a new Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param rulesEngineParameters Rules Engine Configuration properties needed to create a new Rules Engine + * Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rules engine configuration containing a list of rules that will run to modify the runtime behavior of + * the request and response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RulesEngineInner createOrUpdate( + String resourceGroupName, + String frontDoorName, + String rulesEngineName, + RulesEngineInner rulesEngineParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters, context) + .block(); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String frontDoorName, String rulesEngineName) { + 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (rulesEngineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter rulesEngineName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + rulesEngineName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String frontDoorName, String rulesEngineName, 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 (frontDoorName == null) { + return Mono.error(new IllegalArgumentException("Parameter frontDoorName is required and cannot be null.")); + } + if (rulesEngineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter rulesEngineName is required and cannot be null.")); + } + final String apiVersion = "2020-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + frontDoorName, + rulesEngineName, + apiVersion, + accept, + context); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String frontDoorName, String rulesEngineName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, frontDoorName, rulesEngineName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String frontDoorName, String rulesEngineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, frontDoorName, rulesEngineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String frontDoorName, String rulesEngineName) { + return beginDeleteAsync(resourceGroupName, frontDoorName, rulesEngineName).getSyncPoller(); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String frontDoorName, String rulesEngineName, Context context) { + return beginDeleteAsync(resourceGroupName, frontDoorName, rulesEngineName, context).getSyncPoller(); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String frontDoorName, String rulesEngineName) { + return beginDeleteAsync(resourceGroupName, frontDoorName, rulesEngineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String frontDoorName, String rulesEngineName, Context context) { + return beginDeleteAsync(resourceGroupName, frontDoorName, rulesEngineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 frontDoorName, String rulesEngineName) { + deleteAsync(resourceGroupName, frontDoorName, rulesEngineName).block(); + } + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 frontDoorName, String rulesEngineName, Context context) { + deleteAsync(resourceGroupName, frontDoorName, rulesEngineName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Rules Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFrontDoorNextSinglePageAsync(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.listByFrontDoorNext(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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Rules Engine Configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFrontDoorNextSinglePageAsync(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 + .listByFrontDoorNext(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/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEnginesImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEnginesImpl.java new file mode 100644 index 0000000000000..22ee6fe017bcf --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEnginesImpl.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.frontdoor.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.frontdoor.fluent.RulesEnginesClient; +import com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner; +import com.azure.resourcemanager.frontdoor.models.RulesEngine; +import com.azure.resourcemanager.frontdoor.models.RulesEngines; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RulesEnginesImpl implements RulesEngines { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesEnginesImpl.class); + + private final RulesEnginesClient innerClient; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public RulesEnginesImpl( + RulesEnginesClient innerClient, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName) { + PagedIterable inner = this.serviceClient().listByFrontDoor(resourceGroupName, frontDoorName); + return Utils.mapPage(inner, inner1 -> new RulesEngineImpl(inner1, this.manager())); + } + + public PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName, Context context) { + PagedIterable inner = + this.serviceClient().listByFrontDoor(resourceGroupName, frontDoorName, context); + return Utils.mapPage(inner, inner1 -> new RulesEngineImpl(inner1, this.manager())); + } + + public RulesEngine get(String resourceGroupName, String frontDoorName, String rulesEngineName) { + RulesEngineInner inner = this.serviceClient().get(resourceGroupName, frontDoorName, rulesEngineName); + if (inner != null) { + return new RulesEngineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String frontDoorName, String rulesEngineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, frontDoorName, rulesEngineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RulesEngineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String frontDoorName, String rulesEngineName) { + this.serviceClient().delete(resourceGroupName, frontDoorName, rulesEngineName); + } + + public void delete(String resourceGroupName, String frontDoorName, String rulesEngineName, Context context) { + this.serviceClient().delete(resourceGroupName, frontDoorName, rulesEngineName, context); + } + + public RulesEngine getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String frontDoorName = Utils.getValueFromIdByName(id, "frontDoors"); + if (frontDoorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'frontDoors'.", id))); + } + String rulesEngineName = Utils.getValueFromIdByName(id, "rulesEngines"); + if (rulesEngineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rulesEngines'.", id))); + } + return this.getWithResponse(resourceGroupName, frontDoorName, rulesEngineName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String frontDoorName = Utils.getValueFromIdByName(id, "frontDoors"); + if (frontDoorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'frontDoors'.", id))); + } + String rulesEngineName = Utils.getValueFromIdByName(id, "rulesEngines"); + if (rulesEngineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rulesEngines'.", id))); + } + return this.getWithResponse(resourceGroupName, frontDoorName, rulesEngineName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String frontDoorName = Utils.getValueFromIdByName(id, "frontDoors"); + if (frontDoorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'frontDoors'.", id))); + } + String rulesEngineName = Utils.getValueFromIdByName(id, "rulesEngines"); + if (rulesEngineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rulesEngines'.", id))); + } + this.delete(resourceGroupName, frontDoorName, rulesEngineName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String frontDoorName = Utils.getValueFromIdByName(id, "frontDoors"); + if (frontDoorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'frontDoors'.", id))); + } + String rulesEngineName = Utils.getValueFromIdByName(id, "rulesEngines"); + if (rulesEngineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rulesEngines'.", id))); + } + this.delete(resourceGroupName, frontDoorName, rulesEngineName, context); + } + + private RulesEnginesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + public RulesEngineImpl define(String name) { + return new RulesEngineImpl(name, this.manager()); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/TimeseriesImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/TimeseriesImpl.java new file mode 100644 index 0000000000000..8349c8f85a197 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/TimeseriesImpl.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.frontdoor.implementation; + +import com.azure.resourcemanager.frontdoor.fluent.models.TimeseriesInner; +import com.azure.resourcemanager.frontdoor.models.AggregationInterval; +import com.azure.resourcemanager.frontdoor.models.Timeseries; +import com.azure.resourcemanager.frontdoor.models.TimeseriesDataPoint; +import com.azure.resourcemanager.frontdoor.models.TimeseriesType; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class TimeseriesImpl implements Timeseries { + private TimeseriesInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + TimeseriesImpl(TimeseriesInner innerObject, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String 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 endpoint() { + return this.innerModel().endpoint(); + } + + public String startDateTimeUtc() { + return this.innerModel().startDateTimeUtc(); + } + + public String endDateTimeUtc() { + return this.innerModel().endDateTimeUtc(); + } + + public AggregationInterval aggregationInterval() { + return this.innerModel().aggregationInterval(); + } + + public TimeseriesType timeseriesType() { + return this.innerModel().timeseriesType(); + } + + public String country() { + return this.innerModel().country(); + } + + public List timeseriesData() { + List inner = this.innerModel().timeseriesData(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TimeseriesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/Utils.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/Utils.java new file mode 100644 index 0000000000000..aea840e3ce717 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ValidateCustomDomainOutputImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ValidateCustomDomainOutputImpl.java new file mode 100644 index 0000000000000..4d36d80eb7234 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ValidateCustomDomainOutputImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.implementation; + +import com.azure.resourcemanager.frontdoor.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.frontdoor.models.ValidateCustomDomainOutput; + +public final class ValidateCustomDomainOutputImpl implements ValidateCustomDomainOutput { + private ValidateCustomDomainOutputInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + ValidateCustomDomainOutputImpl( + ValidateCustomDomainOutputInner innerObject, + com.azure.resourcemanager.frontdoor.FrontDoorManager 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.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/WebApplicationFirewallPolicyImpl.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/WebApplicationFirewallPolicyImpl.java new file mode 100644 index 0000000000000..02db8173e809c --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/WebApplicationFirewallPolicyImpl.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.frontdoor.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.frontdoor.models.CustomRuleList; +import com.azure.resourcemanager.frontdoor.models.FrontendEndpointLink; +import com.azure.resourcemanager.frontdoor.models.ManagedRuleSetList; +import com.azure.resourcemanager.frontdoor.models.PolicyResourceState; +import com.azure.resourcemanager.frontdoor.models.PolicySettings; +import com.azure.resourcemanager.frontdoor.models.RoutingRuleLink; +import com.azure.resourcemanager.frontdoor.models.SecurityPolicyLink; +import com.azure.resourcemanager.frontdoor.models.Sku; +import com.azure.resourcemanager.frontdoor.models.WebApplicationFirewallPolicy; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class WebApplicationFirewallPolicyImpl + implements WebApplicationFirewallPolicy, + WebApplicationFirewallPolicy.Definition, + WebApplicationFirewallPolicy.Update { + private WebApplicationFirewallPolicyInner innerObject; + + private final com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public PolicySettings policySettings() { + return this.innerModel().policySettings(); + } + + public CustomRuleList customRules() { + return this.innerModel().customRules(); + } + + public ManagedRuleSetList managedRules() { + return this.innerModel().managedRules(); + } + + public List frontendEndpointLinks() { + List inner = this.innerModel().frontendEndpointLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List routingRuleLinks() { + List inner = this.innerModel().routingRuleLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List securityPolicyLinks() { + List inner = this.innerModel().securityPolicyLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String 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 WebApplicationFirewallPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.frontdoor.FrontDoorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String policyName; + + public WebApplicationFirewallPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public WebApplicationFirewallPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .createOrUpdate(resourceGroupName, policyName, this.innerModel(), Context.NONE); + return this; + } + + public WebApplicationFirewallPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .createOrUpdate(resourceGroupName, policyName, this.innerModel(), context); + return this; + } + + WebApplicationFirewallPolicyImpl(String name, com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = new WebApplicationFirewallPolicyInner(); + this.serviceManager = serviceManager; + this.policyName = name; + } + + public WebApplicationFirewallPolicyImpl update() { + return this; + } + + public WebApplicationFirewallPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .createOrUpdate(resourceGroupName, policyName, this.innerModel(), Context.NONE); + return this; + } + + public WebApplicationFirewallPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .createOrUpdate(resourceGroupName, policyName, this.innerModel(), context); + return this; + } + + WebApplicationFirewallPolicyImpl( + WebApplicationFirewallPolicyInner innerObject, + com.azure.resourcemanager.frontdoor.FrontDoorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.policyName = Utils.getValueFromIdByName(innerObject.id(), "FrontDoorWebApplicationFirewallPolicies"); + } + + public WebApplicationFirewallPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE) + .getValue(); + return this; + } + + public WebApplicationFirewallPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, context) + .getValue(); + return this; + } + + public WebApplicationFirewallPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public WebApplicationFirewallPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public WebApplicationFirewallPolicyImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public WebApplicationFirewallPolicyImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public WebApplicationFirewallPolicyImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public WebApplicationFirewallPolicyImpl withPolicySettings(PolicySettings policySettings) { + this.innerModel().withPolicySettings(policySettings); + return this; + } + + public WebApplicationFirewallPolicyImpl withCustomRules(CustomRuleList customRules) { + this.innerModel().withCustomRules(customRules); + return this; + } + + public WebApplicationFirewallPolicyImpl withManagedRules(ManagedRuleSetList managedRules) { + this.innerModel().withManagedRules(managedRules); + return this; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/package-info.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/package-info.java new file mode 100644 index 0000000000000..b3bc8e4e1e4b1 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for FrontDoorManagementClient. FrontDoor Client. */ +package com.azure.resourcemanager.frontdoor.implementation; diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ActionType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ActionType.java new file mode 100644 index 0000000000000..721997e3b1101 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ActionType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Allow for ActionType. */ + public static final ActionType ALLOW = fromString("Allow"); + + /** Static value Block for ActionType. */ + public static final ActionType BLOCK = fromString("Block"); + + /** Static value Log for ActionType. */ + public static final ActionType LOG = fromString("Log"); + + /** Static value Redirect for ActionType. */ + public static final ActionType REDIRECT = fromString("Redirect"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** @return known ActionType values. */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/AggregationInterval.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/AggregationInterval.java new file mode 100644 index 0000000000000..ab3062f74581f --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/AggregationInterval.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AggregationInterval. */ +public final class AggregationInterval extends ExpandableStringEnum { + /** Static value Hourly for AggregationInterval. */ + public static final AggregationInterval HOURLY = fromString("Hourly"); + + /** Static value Daily for AggregationInterval. */ + public static final AggregationInterval DAILY = fromString("Daily"); + + /** + * Creates or finds a AggregationInterval from its string representation. + * + * @param name a name to look for. + * @return the corresponding AggregationInterval. + */ + @JsonCreator + public static AggregationInterval fromString(String name) { + return fromString(name, AggregationInterval.class); + } + + /** @return known AggregationInterval values. */ + public static Collection values() { + return values(AggregationInterval.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Availability.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Availability.java new file mode 100644 index 0000000000000..16b33542a9223 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Availability.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Availability. */ +public final class Availability extends ExpandableStringEnum { + /** Static value Available for Availability. */ + public static final Availability AVAILABLE = fromString("Available"); + + /** Static value Unavailable for Availability. */ + public static final Availability UNAVAILABLE = fromString("Unavailable"); + + /** + * Creates or finds a Availability from its string representation. + * + * @param name a name to look for. + * @return the corresponding Availability. + */ + @JsonCreator + public static Availability fromString(String name) { + return fromString(name, Availability.class); + } + + /** @return known Availability values. */ + public static Collection values() { + return values(Availability.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Backend.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Backend.java new file mode 100644 index 0000000000000..2ad00bb62a19e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Backend.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backend address of a frontDoor load balancer. */ +@Fluent +public final class Backend { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Backend.class); + + /* + * Location of the backend (IP address or FQDN) + */ + @JsonProperty(value = "address") + private String address; + + /* + * The Alias of the Private Link resource. Populating this optional field + * indicates that this backend is 'Private' + */ + @JsonProperty(value = "privateLinkAlias") + private String privateLinkAlias; + + /* + * The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private' + */ + @JsonProperty(value = "privateLinkResourceId") + private String privateLinkResourceId; + + /* + * The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated + */ + @JsonProperty(value = "privateLinkLocation") + private String privateLinkLocation; + + /* + * The Approval status for the connection to the Private Link + */ + @JsonProperty(value = "privateEndpointStatus", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointStatus privateEndpointStatus; + + /* + * A custom message to be included in the approval request to connect to + * the Private Link + */ + @JsonProperty(value = "privateLinkApprovalMessage") + private String privateLinkApprovalMessage; + + /* + * The HTTP TCP port number. Must be between 1 and 65535. + */ + @JsonProperty(value = "httpPort") + private Integer httpPort; + + /* + * The HTTPS TCP port number. Must be between 1 and 65535. + */ + @JsonProperty(value = "httpsPort") + private Integer httpsPort; + + /* + * Whether to enable use of this backend. Permitted values are 'Enabled' or + * 'Disabled' + */ + @JsonProperty(value = "enabledState") + private BackendEnabledState enabledState; + + /* + * Priority to use for load balancing. Higher priorities will not be used + * for load balancing if any lower priority backend is healthy. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * Weight of this endpoint for load balancing purposes. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * The value to use as the host header sent to the backend. If blank or + * unspecified, this defaults to the incoming host. + */ + @JsonProperty(value = "backendHostHeader") + private String backendHostHeader; + + /** + * Get the address property: Location of the backend (IP address or FQDN). + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Location of the backend (IP address or FQDN). + * + * @param address the address value to set. + * @return the Backend object itself. + */ + public Backend withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this backend 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 backend is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the Backend object itself. + */ + public Backend 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 Backend object itself. + */ + public Backend 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 Backend object itself. + */ + public Backend withPrivateLinkLocation(String privateLinkLocation) { + this.privateLinkLocation = privateLinkLocation; + 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; + } + + /** + * 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 Backend object itself. + */ + public Backend withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + this.privateLinkApprovalMessage = privateLinkApprovalMessage; + return this; + } + + /** + * Get the httpPort property: The HTTP TCP port number. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: The HTTP TCP port number. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the Backend object itself. + */ + public Backend withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: The HTTPS TCP port number. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: The HTTPS TCP port number. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the Backend object itself. + */ + public Backend withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the enabledState property: Whether to enable use of this backend. Permitted values are 'Enabled' or + * 'Disabled'. + * + * @return the enabledState value. + */ + public BackendEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Whether to enable use of this backend. Permitted values are 'Enabled' or + * 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the Backend object itself. + */ + public Backend withEnabledState(BackendEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the priority property: Priority to use for load balancing. Higher priorities will not be used for load + * balancing if any lower priority backend is healthy. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority to use for load balancing. Higher priorities will not be used for load + * balancing if any lower priority backend is healthy. + * + * @param priority the priority value to set. + * @return the Backend object itself. + */ + public Backend withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the weight property: Weight of this endpoint for load balancing purposes. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Weight of this endpoint for load balancing purposes. + * + * @param weight the weight value to set. + * @return the Backend object itself. + */ + public Backend withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the backendHostHeader property: The value to use as the host header sent to the backend. If blank or + * unspecified, this defaults to the incoming host. + * + * @return the backendHostHeader value. + */ + public String backendHostHeader() { + return this.backendHostHeader; + } + + /** + * Set the backendHostHeader property: The value to use as the host header sent to the backend. If blank or + * unspecified, this defaults to the incoming host. + * + * @param backendHostHeader the backendHostHeader value to set. + * @return the Backend object itself. + */ + public Backend withBackendHostHeader(String backendHostHeader) { + this.backendHostHeader = backendHostHeader; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendEnabledState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendEnabledState.java new file mode 100644 index 0000000000000..7271eb35e67ec --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendEnabledState.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackendEnabledState. */ +public final class BackendEnabledState extends ExpandableStringEnum { + /** Static value Enabled for BackendEnabledState. */ + public static final BackendEnabledState ENABLED = fromString("Enabled"); + + /** Static value Disabled for BackendEnabledState. */ + public static final BackendEnabledState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a BackendEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackendEnabledState. + */ + @JsonCreator + public static BackendEnabledState fromString(String name) { + return fromString(name, BackendEnabledState.class); + } + + /** @return known BackendEnabledState values. */ + public static Collection values() { + return values(BackendEnabledState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPool.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPool.java new file mode 100644 index 0000000000000..3e95d17b5aa22 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPool.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A backend pool is a collection of backends that can be routed to. */ +@JsonFlatten +@Fluent +public class BackendPool extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendPool.class); + + /* + * Resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The set of backends for this pool + */ + @JsonProperty(value = "properties.backends") + private List backends; + + /* + * Load balancing settings for a backend pool + */ + @JsonProperty(value = "properties.loadBalancingSettings") + private SubResource loadBalancingSettings; + + /* + * L7 health probe settings for a backend pool + */ + @JsonProperty(value = "properties.healthProbeSettings") + private SubResource healthProbeSettings; + + /* + * Resource status. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the BackendPool object itself. + */ + public BackendPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the backends property: The set of backends for this pool. + * + * @return the backends value. + */ + public List backends() { + return this.backends; + } + + /** + * Set the backends property: The set of backends for this pool. + * + * @param backends the backends value to set. + * @return the BackendPool object itself. + */ + public BackendPool withBackends(List backends) { + this.backends = backends; + return this; + } + + /** + * Get the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + public SubResource loadBalancingSettings() { + return this.loadBalancingSettings; + } + + /** + * Set the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the BackendPool object itself. + */ + public BackendPool withLoadBalancingSettings(SubResource loadBalancingSettings) { + this.loadBalancingSettings = loadBalancingSettings; + return this; + } + + /** + * Get the healthProbeSettings property: L7 health probe settings for a backend pool. + * + * @return the healthProbeSettings value. + */ + public SubResource healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: L7 health probe settings for a backend pool. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the BackendPool object itself. + */ + public BackendPool withHealthProbeSettings(SubResource healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public BackendPool withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backends() != null) { + backends().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolProperties.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolProperties.java new file mode 100644 index 0000000000000..0b1ad7aff08a7 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolProperties.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.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties required to create a Backend Pool. */ +@Immutable +public final class BackendPoolProperties extends BackendPoolUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendPoolProperties.class); + + /* + * Resource status. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public BackendPoolProperties withBackends(List backends) { + super.withBackends(backends); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendPoolProperties withLoadBalancingSettings(SubResource loadBalancingSettings) { + super.withLoadBalancingSettings(loadBalancingSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendPoolProperties withHealthProbeSettings(SubResource healthProbeSettings) { + super.withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolUpdateParameters.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolUpdateParameters.java new file mode 100644 index 0000000000000..dca53f35b757e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolUpdateParameters.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of backends that can be routed to. */ +@Fluent +public class BackendPoolUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendPoolUpdateParameters.class); + + /* + * The set of backends for this pool + */ + @JsonProperty(value = "backends") + private List backends; + + /* + * Load balancing settings for a backend pool + */ + @JsonProperty(value = "loadBalancingSettings") + private SubResource loadBalancingSettings; + + /* + * L7 health probe settings for a backend pool + */ + @JsonProperty(value = "healthProbeSettings") + private SubResource healthProbeSettings; + + /** + * Get the backends property: The set of backends for this pool. + * + * @return the backends value. + */ + public List backends() { + return this.backends; + } + + /** + * Set the backends property: The set of backends for this pool. + * + * @param backends the backends value to set. + * @return the BackendPoolUpdateParameters object itself. + */ + public BackendPoolUpdateParameters withBackends(List backends) { + this.backends = backends; + return this; + } + + /** + * Get the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + public SubResource loadBalancingSettings() { + return this.loadBalancingSettings; + } + + /** + * Set the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the BackendPoolUpdateParameters object itself. + */ + public BackendPoolUpdateParameters withLoadBalancingSettings(SubResource loadBalancingSettings) { + this.loadBalancingSettings = loadBalancingSettings; + return this; + } + + /** + * Get the healthProbeSettings property: L7 health probe settings for a backend pool. + * + * @return the healthProbeSettings value. + */ + public SubResource healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: L7 health probe settings for a backend pool. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the BackendPoolUpdateParameters object itself. + */ + public BackendPoolUpdateParameters withHealthProbeSettings(SubResource healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backends() != null) { + backends().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolsSettings.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolsSettings.java new file mode 100644 index 0000000000000..e11d4a758716e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/BackendPoolsSettings.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings that apply to all backend pools. */ +@Fluent +public final class BackendPoolsSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendPoolsSettings.class); + + /* + * Whether to enforce certificate name check on HTTPS requests to all + * backend pools. No effect on non-HTTPS requests. + */ + @JsonProperty(value = "enforceCertificateNameCheck") + private EnforceCertificateNameCheckEnabledState enforceCertificateNameCheck; + + /* + * Send and receive timeout on forwarding request to the backend. When + * timeout is reached, the request fails and returns. + */ + @JsonProperty(value = "sendRecvTimeoutSeconds") + private Integer sendRecvTimeoutSeconds; + + /** + * Get the enforceCertificateNameCheck property: Whether to enforce certificate name check on HTTPS requests to all + * backend pools. No effect on non-HTTPS requests. + * + * @return the enforceCertificateNameCheck value. + */ + public EnforceCertificateNameCheckEnabledState enforceCertificateNameCheck() { + return this.enforceCertificateNameCheck; + } + + /** + * Set the enforceCertificateNameCheck property: Whether to enforce certificate name check on HTTPS requests to all + * backend pools. No effect on non-HTTPS requests. + * + * @param enforceCertificateNameCheck the enforceCertificateNameCheck value to set. + * @return the BackendPoolsSettings object itself. + */ + public BackendPoolsSettings withEnforceCertificateNameCheck( + EnforceCertificateNameCheckEnabledState enforceCertificateNameCheck) { + this.enforceCertificateNameCheck = enforceCertificateNameCheck; + return this; + } + + /** + * Get the sendRecvTimeoutSeconds property: Send and receive timeout on forwarding request to the backend. When + * timeout is reached, the request fails and returns. + * + * @return the sendRecvTimeoutSeconds value. + */ + public Integer sendRecvTimeoutSeconds() { + return this.sendRecvTimeoutSeconds; + } + + /** + * Set the sendRecvTimeoutSeconds property: Send and receive timeout on forwarding request to the backend. When + * timeout is reached, the request fails and returns. + * + * @param sendRecvTimeoutSeconds the sendRecvTimeoutSeconds value to set. + * @return the BackendPoolsSettings object itself. + */ + public BackendPoolsSettings withSendRecvTimeoutSeconds(Integer sendRecvTimeoutSeconds) { + this.sendRecvTimeoutSeconds = sendRecvTimeoutSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CacheConfiguration.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CacheConfiguration.java new file mode 100644 index 0000000000000..caa62c0d18c00 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CacheConfiguration.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** Caching settings for a caching-type route. To disable caching, do not provide a cacheConfiguration object. */ +@Fluent +public final class CacheConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CacheConfiguration.class); + + /* + * Treatment of URL query terms when forming the cache key. + */ + @JsonProperty(value = "queryParameterStripDirective") + private FrontDoorQuery queryParameterStripDirective; + + /* + * query parameters to include or exclude (comma separated). + */ + @JsonProperty(value = "queryParameters") + private String queryParameters; + + /* + * Whether to use dynamic compression for cached content + */ + @JsonProperty(value = "dynamicCompression") + private DynamicCompressionEnabled dynamicCompression; + + /* + * The duration for which the content needs to be cached. Allowed format is + * in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + * HTTP requires the value to be no more than a year + */ + @JsonProperty(value = "cacheDuration") + private Duration cacheDuration; + + /** + * Get the queryParameterStripDirective property: Treatment of URL query terms when forming the cache key. + * + * @return the queryParameterStripDirective value. + */ + public FrontDoorQuery queryParameterStripDirective() { + return this.queryParameterStripDirective; + } + + /** + * Set the queryParameterStripDirective property: Treatment of URL query terms when forming the cache key. + * + * @param queryParameterStripDirective the queryParameterStripDirective value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withQueryParameterStripDirective(FrontDoorQuery queryParameterStripDirective) { + this.queryParameterStripDirective = queryParameterStripDirective; + 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 dynamicCompression property: Whether to use dynamic compression for cached content. + * + * @return the dynamicCompression value. + */ + public DynamicCompressionEnabled dynamicCompression() { + return this.dynamicCompression; + } + + /** + * Set the dynamicCompression property: Whether to use dynamic compression for cached content. + * + * @param dynamicCompression the dynamicCompression value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withDynamicCompression(DynamicCompressionEnabled dynamicCompression) { + this.dynamicCompression = dynamicCompression; + return this; + } + + /** + * Get the cacheDuration property: The duration for which the content needs to be cached. Allowed format is in ISO + * 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). HTTP requires the value to be no more than a year. + * + * @return the cacheDuration value. + */ + public Duration cacheDuration() { + return this.cacheDuration; + } + + /** + * Set the cacheDuration property: The duration for which the content needs to be cached. Allowed format is in ISO + * 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). HTTP requires the value to be no more than a year. + * + * @param cacheDuration the cacheDuration value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withCacheDuration(Duration cacheDuration) { + this.cacheDuration = cacheDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CheckNameAvailabilityInput.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CheckNameAvailabilityInput.java new file mode 100644 index 0000000000000..f24f5ef4c146f --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CheckNameAvailabilityInput.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of CheckNameAvailability API. */ +@Fluent +public final class CheckNameAvailabilityInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityInput.class); + + /* + * The resource name to validate. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of the resource whose name is to be validated. + */ + @JsonProperty(value = "type", required = true) + private ResourceType type; + + /** + * Get the name property: The resource name to validate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The resource name to validate. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the resource whose name is to be validated. + * + * @return the type value. + */ + public ResourceType type() { + return this.type; + } + + /** + * Set the type property: The type of the resource whose name is to be validated. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withType(ResourceType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CheckNameAvailabilityInput")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model CheckNameAvailabilityInput")); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CheckNameAvailabilityOutput.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CheckNameAvailabilityOutput.java new file mode 100644 index 0000000000000..2e07a59d09bc5 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CheckNameAvailabilityOutput.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.resourcemanager.frontdoor.fluent.models.CheckNameAvailabilityOutputInner; + +/** An immutable client-side representation of CheckNameAvailabilityOutput. */ +public interface CheckNameAvailabilityOutput { + /** + * Gets the nameAvailability property: Indicates whether the name is available. + * + * @return the nameAvailability value. + */ + Availability nameAvailability(); + + /** + * 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.frontdoor.fluent.models.CheckNameAvailabilityOutputInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityOutputInner innerModel(); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsConfiguration.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsConfiguration.java new file mode 100644 index 0000000000000..70b5148a67ac8 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsConfiguration.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Https settings for a domain. */ +@JsonFlatten +@Fluent +public class CustomHttpsConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomHttpsConfiguration.class); + + /* + * Defines the source of the SSL certificate + */ + @JsonProperty(value = "certificateSource", required = true) + private FrontDoorCertificateSource certificateSource; + + /* + * Defines the TLS extension protocol that is used for secure delivery + */ + @JsonProperty(value = "protocolType", required = true) + private FrontDoorTlsProtocolType protocolType; + + /* + * The minimum TLS version required from the clients to establish an SSL + * handshake with Front Door. + */ + @JsonProperty(value = "minimumTlsVersion", required = true) + private MinimumTlsVersion minimumTlsVersion; + + /* + * Defines the type of the certificate used for secure connections to a + * frontendEndpoint + */ + @JsonProperty(value = "frontDoorCertificateSourceParameters.certificateType") + private FrontDoorCertificateType certificateType; + + /* + * The Key Vault containing the SSL certificate + */ + @JsonProperty(value = "keyVaultCertificateSourceParameters.vault") + private KeyVaultCertificateSourceParametersVault vault; + + /* + * The name of the Key Vault secret representing the full certificate PFX + */ + @JsonProperty(value = "keyVaultCertificateSourceParameters.secretName") + private String secretName; + + /* + * The version of the Key Vault secret representing the full certificate + * PFX + */ + @JsonProperty(value = "keyVaultCertificateSourceParameters.secretVersion") + private String secretVersion; + + /** + * Get the certificateSource property: Defines the source of the SSL certificate. + * + * @return the certificateSource value. + */ + public FrontDoorCertificateSource certificateSource() { + return this.certificateSource; + } + + /** + * Set the certificateSource property: Defines the source of the SSL certificate. + * + * @param certificateSource the certificateSource value to set. + * @return the CustomHttpsConfiguration object itself. + */ + public CustomHttpsConfiguration withCertificateSource(FrontDoorCertificateSource certificateSource) { + this.certificateSource = certificateSource; + return this; + } + + /** + * Get the protocolType property: Defines the TLS extension protocol that is used for secure delivery. + * + * @return the protocolType value. + */ + public FrontDoorTlsProtocolType 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 CustomHttpsConfiguration object itself. + */ + public CustomHttpsConfiguration withProtocolType(FrontDoorTlsProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get the minimumTlsVersion property: The minimum TLS version required from the clients to establish an SSL + * handshake with Front Door. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: The minimum TLS version required from the clients to establish an SSL + * handshake with Front Door. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the CustomHttpsConfiguration object itself. + */ + public CustomHttpsConfiguration withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the certificateType property: Defines the type of the certificate used for secure connections to a + * frontendEndpoint. + * + * @return the certificateType value. + */ + public FrontDoorCertificateType certificateType() { + return this.certificateType; + } + + /** + * Set the certificateType property: Defines the type of the certificate used for secure connections to a + * frontendEndpoint. + * + * @param certificateType the certificateType value to set. + * @return the CustomHttpsConfiguration object itself. + */ + public CustomHttpsConfiguration withCertificateType(FrontDoorCertificateType certificateType) { + this.certificateType = certificateType; + return this; + } + + /** + * Get the vault property: The Key Vault containing the SSL certificate. + * + * @return the vault value. + */ + public KeyVaultCertificateSourceParametersVault vault() { + return this.vault; + } + + /** + * Set the vault property: The Key Vault containing the SSL certificate. + * + * @param vault the vault value to set. + * @return the CustomHttpsConfiguration object itself. + */ + public CustomHttpsConfiguration withVault(KeyVaultCertificateSourceParametersVault vault) { + this.vault = vault; + return this; + } + + /** + * Get the secretName property: The name of the Key Vault secret representing the full certificate PFX. + * + * @return the secretName value. + */ + public String secretName() { + return this.secretName; + } + + /** + * Set the secretName property: The name of the Key Vault secret representing the full certificate PFX. + * + * @param secretName the secretName value to set. + * @return the CustomHttpsConfiguration object itself. + */ + public CustomHttpsConfiguration withSecretName(String secretName) { + this.secretName = secretName; + return this; + } + + /** + * Get the secretVersion property: The version of the Key Vault secret representing the full certificate PFX. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: The version of the Key Vault secret representing the full certificate PFX. + * + * @param secretVersion the secretVersion value to set. + * @return the CustomHttpsConfiguration object itself. + */ + public CustomHttpsConfiguration withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateSource() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateSource in model CustomHttpsConfiguration")); + } + if (protocolType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocolType in model CustomHttpsConfiguration")); + } + if (minimumTlsVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property minimumTlsVersion in model CustomHttpsConfiguration")); + } + if (vault() != null) { + vault().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsProvisioningState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsProvisioningState.java new file mode 100644 index 0000000000000..2f60cf0cfef90 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsProvisioningState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CustomHttpsProvisioningState. */ +public final class CustomHttpsProvisioningState extends ExpandableStringEnum { + /** Static value Enabling for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState ENABLING = fromString("Enabling"); + + /** Static value Enabled for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState ENABLED = fromString("Enabled"); + + /** Static value Disabling for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState DISABLING = fromString("Disabling"); + + /** Static value Disabled for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState DISABLED = fromString("Disabled"); + + /** Static value Failed for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a CustomHttpsProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomHttpsProvisioningState. + */ + @JsonCreator + public static CustomHttpsProvisioningState fromString(String name) { + return fromString(name, CustomHttpsProvisioningState.class); + } + + /** @return known CustomHttpsProvisioningState values. */ + public static Collection values() { + return values(CustomHttpsProvisioningState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsProvisioningSubstate.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsProvisioningSubstate.java new file mode 100644 index 0000000000000..f72258db05cf3 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomHttpsProvisioningSubstate.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CustomHttpsProvisioningSubstate. */ +public final class CustomHttpsProvisioningSubstate extends ExpandableStringEnum { + /** Static value SubmittingDomainControlValidationRequest for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate SUBMITTING_DOMAIN_CONTROL_VALIDATION_REQUEST = + fromString("SubmittingDomainControlValidationRequest"); + + /** Static value PendingDomainControlValidationREquestApproval for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate PENDING_DOMAIN_CONTROL_VALIDATION_REQUEST_APPROVAL = + fromString("PendingDomainControlValidationREquestApproval"); + + /** Static value DomainControlValidationRequestApproved for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_APPROVED = + fromString("DomainControlValidationRequestApproved"); + + /** Static value DomainControlValidationRequestRejected for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_REJECTED = + fromString("DomainControlValidationRequestRejected"); + + /** Static value DomainControlValidationRequestTimedOut for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_TIMED_OUT = + fromString("DomainControlValidationRequestTimedOut"); + + /** Static value IssuingCertificate for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate ISSUING_CERTIFICATE = fromString("IssuingCertificate"); + + /** Static value DeployingCertificate for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DEPLOYING_CERTIFICATE = fromString("DeployingCertificate"); + + /** Static value CertificateDeployed for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate CERTIFICATE_DEPLOYED = fromString("CertificateDeployed"); + + /** Static value DeletingCertificate for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DELETING_CERTIFICATE = fromString("DeletingCertificate"); + + /** Static value CertificateDeleted for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate CERTIFICATE_DELETED = fromString("CertificateDeleted"); + + /** + * Creates or finds a CustomHttpsProvisioningSubstate from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomHttpsProvisioningSubstate. + */ + @JsonCreator + public static CustomHttpsProvisioningSubstate fromString(String name) { + return fromString(name, CustomHttpsProvisioningSubstate.class); + } + + /** @return known CustomHttpsProvisioningSubstate values. */ + public static Collection values() { + return values(CustomHttpsProvisioningSubstate.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRule.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRule.java new file mode 100644 index 0000000000000..f377b31427182 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRule.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines contents of a web application rule. */ +@Fluent +public final class CustomRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRule.class); + + /* + * Describes the name of the rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Describes priority of the rule. Rules with a lower value will be + * evaluated before rules with a higher value. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /* + * Describes if the custom rule is in enabled or disabled state. Defaults + * to Enabled if not specified. + */ + @JsonProperty(value = "enabledState") + private CustomRuleEnabledState enabledState; + + /* + * Describes type of rule. + */ + @JsonProperty(value = "ruleType", required = true) + private RuleType ruleType; + + /* + * Time window for resetting the rate limit count. Default is 1 minute. + */ + @JsonProperty(value = "rateLimitDurationInMinutes") + private Integer rateLimitDurationInMinutes; + + /* + * Number of allowed requests per client within the time window. + */ + @JsonProperty(value = "rateLimitThreshold") + private Integer rateLimitThreshold; + + /* + * List of match conditions. + */ + @JsonProperty(value = "matchConditions", required = true) + private List matchConditions; + + /* + * Describes what action to be applied when rule matches. + */ + @JsonProperty(value = "action", required = true) + private ActionType action; + + /** + * Get the name property: Describes the name of the rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Describes the name of the 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 priority property: Describes priority of the rule. Rules with a lower value will be evaluated before + * rules with a higher value. + * + * @return the priority value. + */ + public int priority() { + return this.priority; + } + + /** + * Set the priority property: Describes priority of the rule. Rules with a lower value will be evaluated before + * rules with a higher value. + * + * @param priority the priority value to set. + * @return the CustomRule object itself. + */ + public CustomRule withPriority(int priority) { + this.priority = priority; + 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 ruleType property: Describes type of rule. + * + * @return the ruleType value. + */ + public RuleType ruleType() { + return this.ruleType; + } + + /** + * Set the ruleType property: Describes type of rule. + * + * @param ruleType the ruleType value to set. + * @return the CustomRule object itself. + */ + public CustomRule withRuleType(RuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get the rateLimitDurationInMinutes property: Time window for resetting the rate limit count. Default is 1 minute. + * + * @return the rateLimitDurationInMinutes value. + */ + public Integer rateLimitDurationInMinutes() { + return this.rateLimitDurationInMinutes; + } + + /** + * Set the rateLimitDurationInMinutes property: Time window for resetting the rate limit count. Default is 1 minute. + * + * @param rateLimitDurationInMinutes the rateLimitDurationInMinutes value to set. + * @return the CustomRule object itself. + */ + public CustomRule withRateLimitDurationInMinutes(Integer rateLimitDurationInMinutes) { + this.rateLimitDurationInMinutes = rateLimitDurationInMinutes; + return this; + } + + /** + * Get the rateLimitThreshold property: Number of allowed requests per client within the time window. + * + * @return the rateLimitThreshold value. + */ + public Integer rateLimitThreshold() { + return this.rateLimitThreshold; + } + + /** + * Set the rateLimitThreshold property: Number of allowed requests per client within the time window. + * + * @param rateLimitThreshold the rateLimitThreshold value to set. + * @return the CustomRule object itself. + */ + public CustomRule withRateLimitThreshold(Integer rateLimitThreshold) { + this.rateLimitThreshold = rateLimitThreshold; + 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 (ruleType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleType in model CustomRule")); + } + if (matchConditions() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchConditions in model CustomRule")); + } else { + matchConditions().forEach(e -> e.validate()); + } + if (action() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model CustomRule")); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRuleEnabledState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRuleEnabledState.java new file mode 100644 index 0000000000000..8d87051aaf4d5 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRuleEnabledState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CustomRuleEnabledState. */ +public final class CustomRuleEnabledState extends ExpandableStringEnum { + /** Static value Disabled for CustomRuleEnabledState. */ + public static final CustomRuleEnabledState DISABLED = fromString("Disabled"); + + /** Static value Enabled for CustomRuleEnabledState. */ + public static final CustomRuleEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a CustomRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomRuleEnabledState. + */ + @JsonCreator + public static CustomRuleEnabledState fromString(String name) { + return fromString(name, CustomRuleEnabledState.class); + } + + /** @return known CustomRuleEnabledState values. */ + public static Collection values() { + return values(CustomRuleEnabledState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRuleList.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRuleList.java new file mode 100644 index 0000000000000..e74c7c03ed898 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/CustomRuleList.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines contents of custom rules. */ +@Fluent +public final class CustomRuleList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRuleList.class); + + /* + * List of rules + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the rules property: List of rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules. + * + * @param rules the rules value to set. + * @return the CustomRuleList object itself. + */ + public CustomRuleList withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/DynamicCompressionEnabled.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/DynamicCompressionEnabled.java new file mode 100644 index 0000000000000..a8aaa21aaf08a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/DynamicCompressionEnabled.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DynamicCompressionEnabled. */ +public final class DynamicCompressionEnabled extends ExpandableStringEnum { + /** Static value Enabled for DynamicCompressionEnabled. */ + public static final DynamicCompressionEnabled ENABLED = fromString("Enabled"); + + /** Static value Disabled for DynamicCompressionEnabled. */ + public static final DynamicCompressionEnabled DISABLED = fromString("Disabled"); + + /** + * Creates or finds a DynamicCompressionEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding DynamicCompressionEnabled. + */ + @JsonCreator + public static DynamicCompressionEnabled fromString(String name) { + return fromString(name, DynamicCompressionEnabled.class); + } + + /** @return known DynamicCompressionEnabled values. */ + public static Collection values() { + return values(DynamicCompressionEnabled.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Endpoint.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Endpoint.java new file mode 100644 index 0000000000000..3be4b5bbda76b --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Endpoint.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the endpoint properties. */ +@Fluent +public final class Endpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Endpoint.class); + + /* + * The name of the endpoint + */ + @JsonProperty(value = "name") + private String name; + + /* + * The endpoint URL + */ + @JsonProperty(value = "endpoint") + private String endpoint; + + /** + * Get the name property: The name of the endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the endpoint. + * + * @param name the name value to set. + * @return the Endpoint object itself. + */ + public Endpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the endpoint property: The endpoint URL. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: The endpoint URL. + * + * @param endpoint the endpoint value to set. + * @return the Endpoint object itself. + */ + public Endpoint withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/EndpointType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/EndpointType.java new file mode 100644 index 0000000000000..ed9b5a2456967 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/EndpointType.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EndpointType. */ +public final class EndpointType extends ExpandableStringEnum { + /** Static value AFD for EndpointType. */ + public static final EndpointType AFD = fromString("AFD"); + + /** Static value AzureRegion for EndpointType. */ + public static final EndpointType AZURE_REGION = fromString("AzureRegion"); + + /** Static value CDN for EndpointType. */ + public static final EndpointType CDN = fromString("CDN"); + + /** Static value ATM for EndpointType. */ + public static final EndpointType ATM = fromString("ATM"); + + /** + * Creates or finds a EndpointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointType. + */ + @JsonCreator + public static EndpointType fromString(String name) { + return fromString(name, EndpointType.class); + } + + /** @return known EndpointType values. */ + public static Collection values() { + return values(EndpointType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Endpoints.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Endpoints.java new file mode 100644 index 0000000000000..5f671a73b201a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Endpoints.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.frontdoor.models; + +import com.azure.core.util.Context; + +/** Resource collection API of Endpoints. */ +public interface Endpoints { + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @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 frontDoorName, PurgeParameters contentFilePaths); + + /** + * Removes a content from Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @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 frontDoorName, PurgeParameters contentFilePaths, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/EnforceCertificateNameCheckEnabledState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/EnforceCertificateNameCheckEnabledState.java new file mode 100644 index 0000000000000..7dc437556fa4a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/EnforceCertificateNameCheckEnabledState.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnforceCertificateNameCheckEnabledState. */ +public final class EnforceCertificateNameCheckEnabledState + extends ExpandableStringEnum { + /** Static value Enabled for EnforceCertificateNameCheckEnabledState. */ + public static final EnforceCertificateNameCheckEnabledState ENABLED = fromString("Enabled"); + + /** Static value Disabled for EnforceCertificateNameCheckEnabledState. */ + public static final EnforceCertificateNameCheckEnabledState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EnforceCertificateNameCheckEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnforceCertificateNameCheckEnabledState. + */ + @JsonCreator + public static EnforceCertificateNameCheckEnabledState fromString(String name) { + return fromString(name, EnforceCertificateNameCheckEnabledState.class); + } + + /** @return known EnforceCertificateNameCheckEnabledState values. */ + public static Collection values() { + return values(EnforceCertificateNameCheckEnabledState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Error.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Error.java new file mode 100644 index 0000000000000..1b633be6e90d2 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Error.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Error model. */ +@Fluent +public final class Error { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); + + /* + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /* + * The details property. + */ + @JsonProperty(value = "details") + private List details; + + /* + * The innerError property. + */ + @JsonProperty(value = "innerError") + private String innerError; + + /** + * Get the code property: The code property. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The code property. + * + * @param code the code value to set. + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: The message property. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The message property. + * + * @param message the message value to set. + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target property: The target property. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target property. + * + * @param target the target value to set. + * @return the Error object itself. + */ + public Error withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the details property: The details property. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: The details property. + * + * @param details the details value to set. + * @return the Error object itself. + */ + public Error withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the innerError property: The innerError property. + * + * @return the innerError value. + */ + public String innerError() { + return this.innerError; + } + + /** + * Set the innerError property: The innerError property. + * + * @param innerError the innerError value to set. + * @return the Error object itself. + */ + public Error withInnerError(String innerError) { + this.innerError = innerError; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ErrorDetails.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ErrorDetails.java new file mode 100644 index 0000000000000..0989a62507501 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ErrorDetails.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ErrorDetails model. */ +@Fluent +public final class ErrorDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorDetails.class); + + /* + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /* + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code property: The code property. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The code property. + * + * @param code the code value to set. + * @return the ErrorDetails object itself. + */ + public ErrorDetails withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the target property: The target property. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target property. + * + * @param target the target value to set. + * @return the ErrorDetails object itself. + */ + public ErrorDetails withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the message property: The message property. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The message property. + * + * @param message the message value to set. + * @return the ErrorDetails object itself. + */ + public ErrorDetails withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Experiment.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Experiment.java new file mode 100644 index 0000000000000..18589cbc77b9a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Experiment.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.frontdoor.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.fluent.models.ExperimentInner; +import java.util.Map; + +/** An immutable client-side representation of Experiment. */ +public interface Experiment { + /** + * 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 description property: The description of the details or intents of the Experiment. + * + * @return the description value. + */ + String description(); + + /** + * Gets the endpointA property: The endpoint A of an experiment. + * + * @return the endpointA value. + */ + Endpoint endpointA(); + + /** + * Gets the endpointB property: The endpoint B of an experiment. + * + * @return the endpointB value. + */ + Endpoint endpointB(); + + /** + * Gets the enabledState property: The state of the Experiment. + * + * @return the enabledState value. + */ + State enabledState(); + + /** + * Gets the resourceState property: Resource status. + * + * @return the resourceState value. + */ + NetworkExperimentResourceState resourceState(); + + /** + * Gets the status property: The description of Experiment status from the server side. + * + * @return the status value. + */ + String status(); + + /** + * Gets the scriptFileUri property: The uri to the Script used in the Experiment. + * + * @return the scriptFileUri value. + */ + String scriptFileUri(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.frontdoor.fluent.models.ExperimentInner object. + * + * @return the inner object. + */ + ExperimentInner innerModel(); + + /** The entirety of the Experiment definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Experiment definition stages. */ + interface DefinitionStages { + /** The first stage of the Experiment definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Experiment 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 Experiment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @return the next definition stage. + */ + WithCreate withExistingNetworkExperimentProfile(String resourceGroupName, String profileName); + } + /** + * The stage of the Experiment 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.WithDescription, + DefinitionStages.WithEndpointA, + DefinitionStages.WithEndpointB, + DefinitionStages.WithEnabledState { + /** + * Executes the create request. + * + * @return the created resource. + */ + Experiment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Experiment create(Context context); + } + /** The stage of the Experiment 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 Experiment definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the details or intents of the Experiment. + * + * @param description The description of the details or intents of the Experiment. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the Experiment definition allowing to specify endpointA. */ + interface WithEndpointA { + /** + * Specifies the endpointA property: The endpoint A of an experiment. + * + * @param endpointA The endpoint A of an experiment. + * @return the next definition stage. + */ + WithCreate withEndpointA(Endpoint endpointA); + } + /** The stage of the Experiment definition allowing to specify endpointB. */ + interface WithEndpointB { + /** + * Specifies the endpointB property: The endpoint B of an experiment. + * + * @param endpointB The endpoint B of an experiment. + * @return the next definition stage. + */ + WithCreate withEndpointB(Endpoint endpointB); + } + /** The stage of the Experiment definition allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: The state of the Experiment. + * + * @param enabledState The state of the Experiment. + * @return the next definition stage. + */ + WithCreate withEnabledState(State enabledState); + } + } + /** + * Begins update for the Experiment resource. + * + * @return the stage of resource update. + */ + Experiment.Update update(); + + /** The template for Experiment update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithEnabledState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Experiment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Experiment apply(Context context); + } + /** The Experiment update stages. */ + interface UpdateStages { + /** The stage of the Experiment update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Experiment update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the intent or details of the Experiment. + * + * @param description The description of the intent or details of the Experiment. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Experiment update allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: The state of the Experiment. + * + * @param enabledState The state of the Experiment. + * @return the next definition stage. + */ + Update withEnabledState(State enabledState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Experiment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Experiment refresh(Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ExperimentList.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ExperimentList.java new file mode 100644 index 0000000000000..09b27fe0ec2f5 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ExperimentList.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.ExperimentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Defines a list of Experiments. It contains a list of Experiment objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class ExperimentList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExperimentList.class); + + /* + * List of Experiments within a resource group. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of Experiment objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Experiments 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 Experiment 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 Experiment objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ExperimentList object itself. + */ + public ExperimentList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ExperimentUpdateModel.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ExperimentUpdateModel.java new file mode 100644 index 0000000000000..d8bdd871c44a5 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ExperimentUpdateModel.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines modifiable attributes of an Experiment. */ +@JsonFlatten +@Fluent +public class ExperimentUpdateModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExperimentUpdateModel.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The description of the intent or details of the Experiment + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The state of the Experiment + */ + @JsonProperty(value = "properties.enabledState") + private State enabledState; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ExperimentUpdateModel object itself. + */ + public ExperimentUpdateModel withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the description property: The description of the intent or details of the Experiment. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the intent or details of the Experiment. + * + * @param description the description value to set. + * @return the ExperimentUpdateModel object itself. + */ + public ExperimentUpdateModel withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the enabledState property: The state of the Experiment. + * + * @return the enabledState value. + */ + public State enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: The state of the Experiment. + * + * @param enabledState the enabledState value to set. + * @return the ExperimentUpdateModel object itself. + */ + public ExperimentUpdateModel withEnabledState(State enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Experiments.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Experiments.java new file mode 100644 index 0000000000000..4c16a81a2eaf3 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Experiments.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.frontdoor.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 Experiments. */ +public interface Experiments { + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of Experiments. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Gets a list of Experiments. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of Experiments. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an Experiment by ExperimentName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Experiment by ExperimentName. + */ + Experiment get(String resourceGroupName, String profileName, String experimentName); + + /** + * Gets an Experiment by ExperimentName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Experiment by ExperimentName. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String experimentName, Context context); + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 experimentName); + + /** + * Deletes an Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 experimentName, Context context); + + /** + * Gets an Experiment by ExperimentName. + * + * @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 Experiment by ExperimentName. + */ + Experiment getById(String id); + + /** + * Gets an Experiment by ExperimentName. + * + * @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 Experiment by ExperimentName. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Experiment. + * + * @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 Experiment. + * + * @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 Experiment resource. + * + * @param name resource name. + * @return the first stage of the new Experiment definition. + */ + Experiment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ForwardingConfiguration.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ForwardingConfiguration.java new file mode 100644 index 0000000000000..740190596c4c9 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ForwardingConfiguration.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes Forwarding Route. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration") +@JsonFlatten +@Fluent +public class ForwardingConfiguration extends RouteConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ForwardingConfiguration.class); + + /* + * A custom path used to rewrite resource paths matched by this rule. Leave + * empty to use incoming path. + */ + @JsonProperty(value = "customForwardingPath") + private String customForwardingPath; + + /* + * Protocol this rule will use when forwarding traffic to backends. + */ + @JsonProperty(value = "forwardingProtocol") + private FrontDoorForwardingProtocol forwardingProtocol; + + /* + * The caching configuration associated with this rule. + */ + @JsonProperty(value = "cacheConfiguration") + private CacheConfiguration cacheConfiguration; + + /* + * A reference to the BackendPool which this rule routes to. + */ + @JsonProperty(value = "backendPool") + private SubResource backendPool; + + /** + * Get the customForwardingPath property: A custom path used to rewrite resource paths matched by this rule. Leave + * empty to use incoming path. + * + * @return the customForwardingPath value. + */ + public String customForwardingPath() { + return this.customForwardingPath; + } + + /** + * Set the customForwardingPath property: A custom path used to rewrite resource paths matched by this rule. Leave + * empty to use incoming path. + * + * @param customForwardingPath the customForwardingPath value to set. + * @return the ForwardingConfiguration object itself. + */ + public ForwardingConfiguration withCustomForwardingPath(String customForwardingPath) { + this.customForwardingPath = customForwardingPath; + return this; + } + + /** + * Get the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + public FrontDoorForwardingProtocol 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 ForwardingConfiguration object itself. + */ + public ForwardingConfiguration withForwardingProtocol(FrontDoorForwardingProtocol forwardingProtocol) { + this.forwardingProtocol = forwardingProtocol; + return this; + } + + /** + * Get the cacheConfiguration property: The caching configuration associated with this rule. + * + * @return the cacheConfiguration value. + */ + public CacheConfiguration cacheConfiguration() { + return this.cacheConfiguration; + } + + /** + * Set the cacheConfiguration property: The caching configuration associated with this rule. + * + * @param cacheConfiguration the cacheConfiguration value to set. + * @return the ForwardingConfiguration object itself. + */ + public ForwardingConfiguration withCacheConfiguration(CacheConfiguration cacheConfiguration) { + this.cacheConfiguration = cacheConfiguration; + return this; + } + + /** + * Get the backendPool property: A reference to the BackendPool which this rule routes to. + * + * @return the backendPool value. + */ + public SubResource backendPool() { + return this.backendPool; + } + + /** + * Set the backendPool property: A reference to the BackendPool which this rule routes to. + * + * @param backendPool the backendPool value to set. + * @return the ForwardingConfiguration object itself. + */ + public ForwardingConfiguration withBackendPool(SubResource backendPool) { + this.backendPool = backendPool; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (cacheConfiguration() != null) { + cacheConfiguration().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoor.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoor.java new file mode 100644 index 0000000000000..fe92bc3866124 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoor.java @@ -0,0 +1,472 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontDoorInner; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of FrontDoor. */ +public interface FrontDoor { + /** + * 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 friendlyName property: A friendly name for the frontDoor. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the routingRules property: Routing rules associated with this Front Door. + * + * @return the routingRules value. + */ + List routingRules(); + + /** + * Gets the loadBalancingSettings property: Load balancing settings associated with this Front Door instance. + * + * @return the loadBalancingSettings value. + */ + List loadBalancingSettings(); + + /** + * Gets the healthProbeSettings property: Health probe settings associated with this Front Door instance. + * + * @return the healthProbeSettings value. + */ + List healthProbeSettings(); + + /** + * Gets the backendPools property: Backend pools available to routing rules. + * + * @return the backendPools value. + */ + List backendPools(); + + /** + * Gets the frontendEndpoints property: Frontend endpoints available to routing rules. + * + * @return the frontendEndpoints value. + */ + List frontendEndpoints(); + + /** + * Gets the backendPoolsSettings property: Settings for all backendPools. + * + * @return the backendPoolsSettings value. + */ + BackendPoolsSettings backendPoolsSettings(); + + /** + * Gets the enabledState property: Operational status of the Front Door load balancer. Permitted values are + * 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + FrontDoorEnabledState enabledState(); + + /** + * Gets the resourceState property: Resource status of the Front Door. + * + * @return the resourceState value. + */ + FrontDoorResourceState resourceState(); + + /** + * Gets the provisioningState property: Provisioning state of the Front Door. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the cname property: The host that each frontendEndpoint must CNAME to. + * + * @return the cname value. + */ + String cname(); + + /** + * Gets the frontdoorId property: The Id of the frontdoor. + * + * @return the frontdoorId value. + */ + String frontdoorId(); + + /** + * Gets the rulesEngines property: Rules Engine Configurations available to routing rules. + * + * @return the rulesEngines value. + */ + List rulesEngines(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.frontdoor.fluent.models.FrontDoorInner object. + * + * @return the inner object. + */ + FrontDoorInner innerModel(); + + /** The entirety of the FrontDoor definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The FrontDoor definition stages. */ + interface DefinitionStages { + /** The first stage of the FrontDoor definition. */ + interface Blank extends WithLocation { + } + /** The stage of the FrontDoor 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 FrontDoor 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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the FrontDoor 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.WithFriendlyName, + DefinitionStages.WithRoutingRules, + DefinitionStages.WithLoadBalancingSettings, + DefinitionStages.WithHealthProbeSettings, + DefinitionStages.WithBackendPools, + DefinitionStages.WithFrontendEndpoints, + DefinitionStages.WithBackendPoolsSettings, + DefinitionStages.WithEnabledState { + /** + * Executes the create request. + * + * @return the created resource. + */ + FrontDoor create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FrontDoor create(Context context); + } + /** The stage of the FrontDoor 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 FrontDoor definition allowing to specify friendlyName. */ + interface WithFriendlyName { + /** + * Specifies the friendlyName property: A friendly name for the frontDoor. + * + * @param friendlyName A friendly name for the frontDoor. + * @return the next definition stage. + */ + WithCreate withFriendlyName(String friendlyName); + } + /** The stage of the FrontDoor definition allowing to specify routingRules. */ + interface WithRoutingRules { + /** + * Specifies the routingRules property: Routing rules associated with this Front Door.. + * + * @param routingRules Routing rules associated with this Front Door. + * @return the next definition stage. + */ + WithCreate withRoutingRules(List routingRules); + } + /** The stage of the FrontDoor definition allowing to specify loadBalancingSettings. */ + interface WithLoadBalancingSettings { + /** + * Specifies the loadBalancingSettings property: Load balancing settings associated with this Front Door + * instance.. + * + * @param loadBalancingSettings Load balancing settings associated with this Front Door instance. + * @return the next definition stage. + */ + WithCreate withLoadBalancingSettings(List loadBalancingSettings); + } + /** The stage of the FrontDoor definition allowing to specify healthProbeSettings. */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings associated with this Front Door + * instance.. + * + * @param healthProbeSettings Health probe settings associated with this Front Door instance. + * @return the next definition stage. + */ + WithCreate withHealthProbeSettings(List healthProbeSettings); + } + /** The stage of the FrontDoor definition allowing to specify backendPools. */ + interface WithBackendPools { + /** + * Specifies the backendPools property: Backend pools available to routing rules.. + * + * @param backendPools Backend pools available to routing rules. + * @return the next definition stage. + */ + WithCreate withBackendPools(List backendPools); + } + /** The stage of the FrontDoor definition allowing to specify frontendEndpoints. */ + interface WithFrontendEndpoints { + /** + * Specifies the frontendEndpoints property: Frontend endpoints available to routing rules.. + * + * @param frontendEndpoints Frontend endpoints available to routing rules. + * @return the next definition stage. + */ + WithCreate withFrontendEndpoints(List frontendEndpoints); + } + /** The stage of the FrontDoor definition allowing to specify backendPoolsSettings. */ + interface WithBackendPoolsSettings { + /** + * Specifies the backendPoolsSettings property: Settings for all backendPools. + * + * @param backendPoolsSettings Settings for all backendPools. + * @return the next definition stage. + */ + WithCreate withBackendPoolsSettings(BackendPoolsSettings backendPoolsSettings); + } + /** The stage of the FrontDoor definition allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Operational status of the Front Door load balancer. Permitted values + * are 'Enabled' or 'Disabled'. + * + * @param enabledState Operational status of the Front Door load balancer. Permitted values are 'Enabled' or + * 'Disabled'. + * @return the next definition stage. + */ + WithCreate withEnabledState(FrontDoorEnabledState enabledState); + } + } + /** + * Begins update for the FrontDoor resource. + * + * @return the stage of resource update. + */ + FrontDoor.Update update(); + + /** The template for FrontDoor update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithFriendlyName, + UpdateStages.WithRoutingRules, + UpdateStages.WithLoadBalancingSettings, + UpdateStages.WithHealthProbeSettings, + UpdateStages.WithBackendPools, + UpdateStages.WithFrontendEndpoints, + UpdateStages.WithBackendPoolsSettings, + UpdateStages.WithEnabledState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FrontDoor apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FrontDoor apply(Context context); + } + /** The FrontDoor update stages. */ + interface UpdateStages { + /** The stage of the FrontDoor update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the FrontDoor update allowing to specify friendlyName. */ + interface WithFriendlyName { + /** + * Specifies the friendlyName property: A friendly name for the frontDoor. + * + * @param friendlyName A friendly name for the frontDoor. + * @return the next definition stage. + */ + Update withFriendlyName(String friendlyName); + } + /** The stage of the FrontDoor update allowing to specify routingRules. */ + interface WithRoutingRules { + /** + * Specifies the routingRules property: Routing rules associated with this Front Door.. + * + * @param routingRules Routing rules associated with this Front Door. + * @return the next definition stage. + */ + Update withRoutingRules(List routingRules); + } + /** The stage of the FrontDoor update allowing to specify loadBalancingSettings. */ + interface WithLoadBalancingSettings { + /** + * Specifies the loadBalancingSettings property: Load balancing settings associated with this Front Door + * instance.. + * + * @param loadBalancingSettings Load balancing settings associated with this Front Door instance. + * @return the next definition stage. + */ + Update withLoadBalancingSettings(List loadBalancingSettings); + } + /** The stage of the FrontDoor update allowing to specify healthProbeSettings. */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings associated with this Front Door + * instance.. + * + * @param healthProbeSettings Health probe settings associated with this Front Door instance. + * @return the next definition stage. + */ + Update withHealthProbeSettings(List healthProbeSettings); + } + /** The stage of the FrontDoor update allowing to specify backendPools. */ + interface WithBackendPools { + /** + * Specifies the backendPools property: Backend pools available to routing rules.. + * + * @param backendPools Backend pools available to routing rules. + * @return the next definition stage. + */ + Update withBackendPools(List backendPools); + } + /** The stage of the FrontDoor update allowing to specify frontendEndpoints. */ + interface WithFrontendEndpoints { + /** + * Specifies the frontendEndpoints property: Frontend endpoints available to routing rules.. + * + * @param frontendEndpoints Frontend endpoints available to routing rules. + * @return the next definition stage. + */ + Update withFrontendEndpoints(List frontendEndpoints); + } + /** The stage of the FrontDoor update allowing to specify backendPoolsSettings. */ + interface WithBackendPoolsSettings { + /** + * Specifies the backendPoolsSettings property: Settings for all backendPools. + * + * @param backendPoolsSettings Settings for all backendPools. + * @return the next definition stage. + */ + Update withBackendPoolsSettings(BackendPoolsSettings backendPoolsSettings); + } + /** The stage of the FrontDoor update allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Operational status of the Front Door load balancer. Permitted values + * are 'Enabled' or 'Disabled'. + * + * @param enabledState Operational status of the Front Door load balancer. Permitted values are 'Enabled' or + * 'Disabled'. + * @return the next definition stage. + */ + Update withEnabledState(FrontDoorEnabledState enabledState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FrontDoor refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FrontDoor refresh(Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorCertificateSource.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorCertificateSource.java new file mode 100644 index 0000000000000..a19b708db0cd7 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorCertificateSource.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorCertificateSource. */ +public final class FrontDoorCertificateSource extends ExpandableStringEnum { + /** Static value AzureKeyVault for FrontDoorCertificateSource. */ + public static final FrontDoorCertificateSource AZURE_KEY_VAULT = fromString("AzureKeyVault"); + + /** Static value FrontDoor for FrontDoorCertificateSource. */ + public static final FrontDoorCertificateSource FRONT_DOOR = fromString("FrontDoor"); + + /** + * Creates or finds a FrontDoorCertificateSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorCertificateSource. + */ + @JsonCreator + public static FrontDoorCertificateSource fromString(String name) { + return fromString(name, FrontDoorCertificateSource.class); + } + + /** @return known FrontDoorCertificateSource values. */ + public static Collection values() { + return values(FrontDoorCertificateSource.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorCertificateType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorCertificateType.java new file mode 100644 index 0000000000000..cc7f35ba234e5 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorCertificateType.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorCertificateType. */ +public final class FrontDoorCertificateType extends ExpandableStringEnum { + /** Static value Dedicated for FrontDoorCertificateType. */ + public static final FrontDoorCertificateType DEDICATED = fromString("Dedicated"); + + /** + * Creates or finds a FrontDoorCertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorCertificateType. + */ + @JsonCreator + public static FrontDoorCertificateType fromString(String name) { + return fromString(name, FrontDoorCertificateType.class); + } + + /** @return known FrontDoorCertificateType values. */ + public static Collection values() { + return values(FrontDoorCertificateType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorEnabledState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorEnabledState.java new file mode 100644 index 0000000000000..b070901c1829b --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorEnabledState.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorEnabledState. */ +public final class FrontDoorEnabledState extends ExpandableStringEnum { + /** Static value Enabled for FrontDoorEnabledState. */ + public static final FrontDoorEnabledState ENABLED = fromString("Enabled"); + + /** Static value Disabled for FrontDoorEnabledState. */ + public static final FrontDoorEnabledState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a FrontDoorEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorEnabledState. + */ + @JsonCreator + public static FrontDoorEnabledState fromString(String name) { + return fromString(name, FrontDoorEnabledState.class); + } + + /** @return known FrontDoorEnabledState values. */ + public static Collection values() { + return values(FrontDoorEnabledState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorForwardingProtocol.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorForwardingProtocol.java new file mode 100644 index 0000000000000..9bb1abea85840 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorForwardingProtocol.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorForwardingProtocol. */ +public final class FrontDoorForwardingProtocol extends ExpandableStringEnum { + /** Static value HttpOnly for FrontDoorForwardingProtocol. */ + public static final FrontDoorForwardingProtocol HTTP_ONLY = fromString("HttpOnly"); + + /** Static value HttpsOnly for FrontDoorForwardingProtocol. */ + public static final FrontDoorForwardingProtocol HTTPS_ONLY = fromString("HttpsOnly"); + + /** Static value MatchRequest for FrontDoorForwardingProtocol. */ + public static final FrontDoorForwardingProtocol MATCH_REQUEST = fromString("MatchRequest"); + + /** + * Creates or finds a FrontDoorForwardingProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorForwardingProtocol. + */ + @JsonCreator + public static FrontDoorForwardingProtocol fromString(String name) { + return fromString(name, FrontDoorForwardingProtocol.class); + } + + /** @return known FrontDoorForwardingProtocol values. */ + public static Collection values() { + return values(FrontDoorForwardingProtocol.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorHealthProbeMethod.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorHealthProbeMethod.java new file mode 100644 index 0000000000000..f1ab5c4558383 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorHealthProbeMethod.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorHealthProbeMethod. */ +public final class FrontDoorHealthProbeMethod extends ExpandableStringEnum { + /** Static value GET for FrontDoorHealthProbeMethod. */ + public static final FrontDoorHealthProbeMethod GET = fromString("GET"); + + /** Static value HEAD for FrontDoorHealthProbeMethod. */ + public static final FrontDoorHealthProbeMethod HEAD = fromString("HEAD"); + + /** + * Creates or finds a FrontDoorHealthProbeMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorHealthProbeMethod. + */ + @JsonCreator + public static FrontDoorHealthProbeMethod fromString(String name) { + return fromString(name, FrontDoorHealthProbeMethod.class); + } + + /** @return known FrontDoorHealthProbeMethod values. */ + public static Collection values() { + return values(FrontDoorHealthProbeMethod.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorListResult.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorListResult.java new file mode 100644 index 0000000000000..6e072d694d845 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontDoorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Front Doors. It contains a list of Front Door objects and a URL link to get the next + * set of results. + */ +@Fluent +public final class FrontDoorListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontDoorListResult.class); + + /* + * List of Front Doors within a resource group. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of Front Door objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Front Doors 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 Front Door 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 Front Door objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the FrontDoorListResult object itself. + */ + public FrontDoorListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorNameAvailabilities.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorNameAvailabilities.java new file mode 100644 index 0000000000000..1604aad5011a4 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorNameAvailabilities.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.frontdoor.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FrontDoorNameAvailabilities. */ +public interface FrontDoorNameAvailabilities { + /** + * Check the availability of a Front Door resource name. + * + * @param checkFrontDoorNameAvailabilityInput 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 check(CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput); + + /** + * Check the availability of a Front Door resource name. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + Response checkWithResponse( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorNameAvailabilityWithSubscriptions.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorNameAvailabilityWithSubscriptions.java new file mode 100644 index 0000000000000..8f454b1ed9b11 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorNameAvailabilityWithSubscriptions.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.frontdoor.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FrontDoorNameAvailabilityWithSubscriptions. */ +public interface FrontDoorNameAvailabilityWithSubscriptions { + /** + * Check the availability of a Front Door subdomain. + * + * @param checkFrontDoorNameAvailabilityInput 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 check(CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput); + + /** + * Check the availability of a Front Door subdomain. + * + * @param checkFrontDoorNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + Response checkWithResponse( + CheckNameAvailabilityInput checkFrontDoorNameAvailabilityInput, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorProperties.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorProperties.java new file mode 100644 index 0000000000000..29da5e1e4c6f6 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorProperties.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.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner; +import com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties required to create an endpoint. */ +@Immutable +public final class FrontDoorProperties extends FrontDoorUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontDoorProperties.class); + + /* + * Resource status of the Front Door. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /* + * Provisioning state of the Front Door. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The host that each frontendEndpoint must CNAME to. + */ + @JsonProperty(value = "cname", access = JsonProperty.Access.WRITE_ONLY) + private String cname; + + /* + * The Id of the frontdoor. + */ + @JsonProperty(value = "frontdoorId", access = JsonProperty.Access.WRITE_ONLY) + private String frontdoorId; + + /* + * Rules Engine Configurations available to routing rules. + */ + @JsonProperty(value = "rulesEngines", access = JsonProperty.Access.WRITE_ONLY) + private List rulesEngines; + + /** + * Get the resourceState property: Resource status of the Front Door. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning state of the Front Door. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the cname property: The host that each frontendEndpoint must CNAME to. + * + * @return the cname value. + */ + public String cname() { + return this.cname; + } + + /** + * Get the frontdoorId property: The Id of the frontdoor. + * + * @return the frontdoorId value. + */ + public String frontdoorId() { + return this.frontdoorId; + } + + /** + * Get the rulesEngines property: Rules Engine Configurations available to routing rules. + * + * @return the rulesEngines value. + */ + public List rulesEngines() { + return this.rulesEngines; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorProperties withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorProperties withRoutingRules(List routingRules) { + super.withRoutingRules(routingRules); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorProperties withLoadBalancingSettings(List loadBalancingSettings) { + super.withLoadBalancingSettings(loadBalancingSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorProperties withHealthProbeSettings(List healthProbeSettings) { + super.withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorProperties withBackendPools(List backendPools) { + super.withBackendPools(backendPools); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorProperties withFrontendEndpoints(List frontendEndpoints) { + super.withFrontendEndpoints(frontendEndpoints); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorProperties withBackendPoolsSettings(BackendPoolsSettings backendPoolsSettings) { + super.withBackendPoolsSettings(backendPoolsSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontDoorProperties withEnabledState(FrontDoorEnabledState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (rulesEngines() != null) { + rulesEngines().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorProtocol.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorProtocol.java new file mode 100644 index 0000000000000..d7c6ae2c82339 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorProtocol.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorProtocol. */ +public final class FrontDoorProtocol extends ExpandableStringEnum { + /** Static value Http for FrontDoorProtocol. */ + public static final FrontDoorProtocol HTTP = fromString("Http"); + + /** Static value Https for FrontDoorProtocol. */ + public static final FrontDoorProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a FrontDoorProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorProtocol. + */ + @JsonCreator + public static FrontDoorProtocol fromString(String name) { + return fromString(name, FrontDoorProtocol.class); + } + + /** @return known FrontDoorProtocol values. */ + public static Collection values() { + return values(FrontDoorProtocol.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorQuery.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorQuery.java new file mode 100644 index 0000000000000..1dafacf84077d --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorQuery.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorQuery. */ +public final class FrontDoorQuery extends ExpandableStringEnum { + /** Static value StripNone for FrontDoorQuery. */ + public static final FrontDoorQuery STRIP_NONE = fromString("StripNone"); + + /** Static value StripAll for FrontDoorQuery. */ + public static final FrontDoorQuery STRIP_ALL = fromString("StripAll"); + + /** Static value StripOnly for FrontDoorQuery. */ + public static final FrontDoorQuery STRIP_ONLY = fromString("StripOnly"); + + /** Static value StripAllExcept for FrontDoorQuery. */ + public static final FrontDoorQuery STRIP_ALL_EXCEPT = fromString("StripAllExcept"); + + /** + * Creates or finds a FrontDoorQuery from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorQuery. + */ + @JsonCreator + public static FrontDoorQuery fromString(String name) { + return fromString(name, FrontDoorQuery.class); + } + + /** @return known FrontDoorQuery values. */ + public static Collection values() { + return values(FrontDoorQuery.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorRedirectProtocol.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorRedirectProtocol.java new file mode 100644 index 0000000000000..555d56312798e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorRedirectProtocol.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorRedirectProtocol. */ +public final class FrontDoorRedirectProtocol extends ExpandableStringEnum { + /** Static value HttpOnly for FrontDoorRedirectProtocol. */ + public static final FrontDoorRedirectProtocol HTTP_ONLY = fromString("HttpOnly"); + + /** Static value HttpsOnly for FrontDoorRedirectProtocol. */ + public static final FrontDoorRedirectProtocol HTTPS_ONLY = fromString("HttpsOnly"); + + /** Static value MatchRequest for FrontDoorRedirectProtocol. */ + public static final FrontDoorRedirectProtocol MATCH_REQUEST = fromString("MatchRequest"); + + /** + * Creates or finds a FrontDoorRedirectProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorRedirectProtocol. + */ + @JsonCreator + public static FrontDoorRedirectProtocol fromString(String name) { + return fromString(name, FrontDoorRedirectProtocol.class); + } + + /** @return known FrontDoorRedirectProtocol values. */ + public static Collection values() { + return values(FrontDoorRedirectProtocol.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorRedirectType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorRedirectType.java new file mode 100644 index 0000000000000..3f0a4a8954b83 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorRedirectType.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorRedirectType. */ +public final class FrontDoorRedirectType extends ExpandableStringEnum { + /** Static value Moved for FrontDoorRedirectType. */ + public static final FrontDoorRedirectType MOVED = fromString("Moved"); + + /** Static value Found for FrontDoorRedirectType. */ + public static final FrontDoorRedirectType FOUND = fromString("Found"); + + /** Static value TemporaryRedirect for FrontDoorRedirectType. */ + public static final FrontDoorRedirectType TEMPORARY_REDIRECT = fromString("TemporaryRedirect"); + + /** Static value PermanentRedirect for FrontDoorRedirectType. */ + public static final FrontDoorRedirectType PERMANENT_REDIRECT = fromString("PermanentRedirect"); + + /** + * Creates or finds a FrontDoorRedirectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorRedirectType. + */ + @JsonCreator + public static FrontDoorRedirectType fromString(String name) { + return fromString(name, FrontDoorRedirectType.class); + } + + /** @return known FrontDoorRedirectType values. */ + public static Collection values() { + return values(FrontDoorRedirectType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorResourceState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorResourceState.java new file mode 100644 index 0000000000000..7e38035b6dbd2 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorResourceState.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorResourceState. */ +public final class FrontDoorResourceState extends ExpandableStringEnum { + /** Static value Creating for FrontDoorResourceState. */ + public static final FrontDoorResourceState CREATING = fromString("Creating"); + + /** Static value Enabling for FrontDoorResourceState. */ + public static final FrontDoorResourceState ENABLING = fromString("Enabling"); + + /** Static value Enabled for FrontDoorResourceState. */ + public static final FrontDoorResourceState ENABLED = fromString("Enabled"); + + /** Static value Disabling for FrontDoorResourceState. */ + public static final FrontDoorResourceState DISABLING = fromString("Disabling"); + + /** Static value Disabled for FrontDoorResourceState. */ + public static final FrontDoorResourceState DISABLED = fromString("Disabled"); + + /** Static value Deleting for FrontDoorResourceState. */ + public static final FrontDoorResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a FrontDoorResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorResourceState. + */ + @JsonCreator + public static FrontDoorResourceState fromString(String name) { + return fromString(name, FrontDoorResourceState.class); + } + + /** @return known FrontDoorResourceState values. */ + public static Collection values() { + return values(FrontDoorResourceState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorTlsProtocolType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorTlsProtocolType.java new file mode 100644 index 0000000000000..d990066ef1ec5 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorTlsProtocolType.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FrontDoorTlsProtocolType. */ +public final class FrontDoorTlsProtocolType extends ExpandableStringEnum { + /** Static value ServerNameIndication for FrontDoorTlsProtocolType. */ + public static final FrontDoorTlsProtocolType SERVER_NAME_INDICATION = fromString("ServerNameIndication"); + + /** + * Creates or finds a FrontDoorTlsProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FrontDoorTlsProtocolType. + */ + @JsonCreator + public static FrontDoorTlsProtocolType fromString(String name) { + return fromString(name, FrontDoorTlsProtocolType.class); + } + + /** @return known FrontDoorTlsProtocolType values. */ + public static Collection values() { + return values(FrontDoorTlsProtocolType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorUpdateParameters.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorUpdateParameters.java new file mode 100644 index 0000000000000..f12227223573a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoorUpdateParameters.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties needed to update a Front Door. */ +@Fluent +public class FrontDoorUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontDoorUpdateParameters.class); + + /* + * A friendly name for the frontDoor + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Routing rules associated with this Front Door. + */ + @JsonProperty(value = "routingRules") + private List routingRules; + + /* + * Load balancing settings associated with this Front Door instance. + */ + @JsonProperty(value = "loadBalancingSettings") + private List loadBalancingSettings; + + /* + * Health probe settings associated with this Front Door instance. + */ + @JsonProperty(value = "healthProbeSettings") + private List healthProbeSettings; + + /* + * Backend pools available to routing rules. + */ + @JsonProperty(value = "backendPools") + private List backendPools; + + /* + * Frontend endpoints available to routing rules. + */ + @JsonProperty(value = "frontendEndpoints") + private List frontendEndpoints; + + /* + * Settings for all backendPools + */ + @JsonProperty(value = "backendPoolsSettings") + private BackendPoolsSettings backendPoolsSettings; + + /* + * Operational status of the Front Door load balancer. Permitted values are + * 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "enabledState") + private FrontDoorEnabledState enabledState; + + /** + * Get the friendlyName property: A friendly name for the frontDoor. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: A friendly name for the frontDoor. + * + * @param friendlyName the friendlyName value to set. + * @return the FrontDoorUpdateParameters object itself. + */ + public FrontDoorUpdateParameters withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the routingRules property: Routing rules associated with this Front Door. + * + * @return the routingRules value. + */ + public List routingRules() { + return this.routingRules; + } + + /** + * Set the routingRules property: Routing rules associated with this Front Door. + * + * @param routingRules the routingRules value to set. + * @return the FrontDoorUpdateParameters object itself. + */ + public FrontDoorUpdateParameters withRoutingRules(List routingRules) { + this.routingRules = routingRules; + return this; + } + + /** + * Get the loadBalancingSettings property: Load balancing settings associated with this Front Door instance. + * + * @return the loadBalancingSettings value. + */ + public List loadBalancingSettings() { + return this.loadBalancingSettings; + } + + /** + * Set the loadBalancingSettings property: Load balancing settings associated with this Front Door instance. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the FrontDoorUpdateParameters object itself. + */ + public FrontDoorUpdateParameters withLoadBalancingSettings(List loadBalancingSettings) { + this.loadBalancingSettings = loadBalancingSettings; + return this; + } + + /** + * Get the healthProbeSettings property: Health probe settings associated with this Front Door instance. + * + * @return the healthProbeSettings value. + */ + public List healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: Health probe settings associated with this Front Door instance. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the FrontDoorUpdateParameters object itself. + */ + public FrontDoorUpdateParameters withHealthProbeSettings(List healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Get the backendPools property: Backend pools available to routing rules. + * + * @return the backendPools value. + */ + public List backendPools() { + return this.backendPools; + } + + /** + * Set the backendPools property: Backend pools available to routing rules. + * + * @param backendPools the backendPools value to set. + * @return the FrontDoorUpdateParameters object itself. + */ + public FrontDoorUpdateParameters withBackendPools(List backendPools) { + this.backendPools = backendPools; + return this; + } + + /** + * Get the frontendEndpoints property: Frontend endpoints available to routing rules. + * + * @return the frontendEndpoints value. + */ + public List frontendEndpoints() { + return this.frontendEndpoints; + } + + /** + * Set the frontendEndpoints property: Frontend endpoints available to routing rules. + * + * @param frontendEndpoints the frontendEndpoints value to set. + * @return the FrontDoorUpdateParameters object itself. + */ + public FrontDoorUpdateParameters withFrontendEndpoints(List frontendEndpoints) { + this.frontendEndpoints = frontendEndpoints; + return this; + } + + /** + * Get the backendPoolsSettings property: Settings for all backendPools. + * + * @return the backendPoolsSettings value. + */ + public BackendPoolsSettings backendPoolsSettings() { + return this.backendPoolsSettings; + } + + /** + * Set the backendPoolsSettings property: Settings for all backendPools. + * + * @param backendPoolsSettings the backendPoolsSettings value to set. + * @return the FrontDoorUpdateParameters object itself. + */ + public FrontDoorUpdateParameters withBackendPoolsSettings(BackendPoolsSettings backendPoolsSettings) { + this.backendPoolsSettings = backendPoolsSettings; + return this; + } + + /** + * Get the enabledState property: Operational status of the Front Door load balancer. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @return the enabledState value. + */ + public FrontDoorEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Operational status of the Front Door load balancer. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the FrontDoorUpdateParameters object itself. + */ + public FrontDoorUpdateParameters withEnabledState(FrontDoorEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routingRules() != null) { + routingRules().forEach(e -> e.validate()); + } + if (loadBalancingSettings() != null) { + loadBalancingSettings().forEach(e -> e.validate()); + } + if (healthProbeSettings() != null) { + healthProbeSettings().forEach(e -> e.validate()); + } + if (backendPools() != null) { + backendPools().forEach(e -> e.validate()); + } + if (frontendEndpoints() != null) { + frontendEndpoints().forEach(e -> e.validate()); + } + if (backendPoolsSettings() != null) { + backendPoolsSettings().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoors.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoors.java new file mode 100644 index 0000000000000..da8f59524f629 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontDoors.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.frontdoor.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 FrontDoors. */ +public interface FrontDoors { + /** + * Lists all of the Front Doors 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 Front Doors. + */ + PagedIterable list(); + + /** + * Lists all of the Front Doors 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 Front Doors. + */ + PagedIterable list(Context context); + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @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 Front Doors. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Front Door with the specified Front Door name under the specified subscription and resource group. + */ + FrontDoor getByResourceGroup(String resourceGroupName, String frontDoorName); + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Front Door with the specified Front Door name under the specified subscription and resource group. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String frontDoorName, Context context); + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 frontDoorName); + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 frontDoorName, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @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 frontDoorName, ValidateCustomDomainInput customDomainProperties); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + Response validateCustomDomainWithResponse( + String resourceGroupName, + String frontDoorName, + ValidateCustomDomainInput customDomainProperties, + Context context); + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Front Door with the specified Front Door name under the specified subscription and resource group. + */ + FrontDoor getById(String id); + + /** + * Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Front Door with the specified Front Door name under the specified subscription and resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @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 Front Door with the specified parameters. + * + * @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 FrontDoor resource. + * + * @param name resource name. + * @return the first stage of the new FrontDoor definition. + */ + FrontDoor.DefinitionStages.Blank define(String name); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpoint.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpoint.java new file mode 100644 index 0000000000000..9422a17d5525e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpoint.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.frontdoor.models; + +import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner; + +/** An immutable client-side representation of FrontendEndpoint. */ +public interface FrontendEndpoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the hostname property: The host name of the frontendEndpoint. Must be a domain name. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the sessionAffinityEnabledState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityEnabledState value. + */ + SessionAffinityEnabledState sessionAffinityEnabledState(); + + /** + * Gets the sessionAffinityTtlSeconds property: UNUSED. This field will be ignored. The TTL to use in seconds for + * session affinity, if applicable. + * + * @return the sessionAffinityTtlSeconds value. + */ + Integer sessionAffinityTtlSeconds(); + + /** + * Gets the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for each host (if + * applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink(); + + /** + * Gets the resourceState property: Resource status. + * + * @return the resourceState value. + */ + FrontDoorResourceState resourceState(); + + /** + * Gets the customHttpsProvisioningState property: Provisioning status of Custom Https of the frontendEndpoint. + * + * @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 customHttpsConfiguration property: The configuration specifying how to enable HTTPS. + * + * @return the customHttpsConfiguration value. + */ + CustomHttpsConfiguration customHttpsConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner object. + * + * @return the inner object. + */ + FrontendEndpointInner innerModel(); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointLink.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointLink.java new file mode 100644 index 0000000000000..48e2889c403b1 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointLink.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the Resource ID for a Frontend Endpoint. */ +@Fluent +public final class FrontendEndpointLink { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontendEndpointLink.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the FrontendEndpointLink object itself. + */ + public FrontendEndpointLink withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointProperties.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointProperties.java new file mode 100644 index 0000000000000..bf79f3a858c18 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointProperties.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.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties required to create a frontend endpoint. */ +@Immutable +public final class FrontendEndpointProperties extends FrontendEndpointUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontendEndpointProperties.class); + + /* + * Resource status. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /* + * Provisioning status of Custom Https of the frontendEndpoint. + */ + @JsonProperty(value = "customHttpsProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningState customHttpsProvisioningState; + + /* + * Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. + */ + @JsonProperty(value = "customHttpsProvisioningSubstate", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate; + + /* + * The configuration specifying how to enable HTTPS + */ + @JsonProperty(value = "customHttpsConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsConfiguration customHttpsConfiguration; + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the customHttpsProvisioningState property: Provisioning status of Custom Https of the frontendEndpoint. + * + * @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 customHttpsConfiguration property: The configuration specifying how to enable HTTPS. + * + * @return the customHttpsConfiguration value. + */ + public CustomHttpsConfiguration customHttpsConfiguration() { + return this.customHttpsConfiguration; + } + + /** {@inheritDoc} */ + @Override + public FrontendEndpointProperties withHostname(String hostname) { + super.withHostname(hostname); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontendEndpointProperties withSessionAffinityEnabledState( + SessionAffinityEnabledState sessionAffinityEnabledState) { + super.withSessionAffinityEnabledState(sessionAffinityEnabledState); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontendEndpointProperties withSessionAffinityTtlSeconds(Integer sessionAffinityTtlSeconds) { + super.withSessionAffinityTtlSeconds(sessionAffinityTtlSeconds); + return this; + } + + /** {@inheritDoc} */ + @Override + public FrontendEndpointProperties withWebApplicationFirewallPolicyLink( + FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + super.withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (customHttpsConfiguration() != null) { + customHttpsConfiguration().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointUpdateParameters.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointUpdateParameters.java new file mode 100644 index 0000000000000..aa464ed08b3ee --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointUpdateParameters.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Frontend endpoint used in routing rule. */ +@Fluent +public class FrontendEndpointUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontendEndpointUpdateParameters.class); + + /* + * The host name of the frontendEndpoint. Must be a domain name. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "sessionAffinityEnabledState") + private SessionAffinityEnabledState sessionAffinityEnabledState; + + /* + * UNUSED. This field will be ignored. The TTL to use in seconds for + * session affinity, if applicable. + */ + @JsonProperty(value = "sessionAffinityTtlSeconds") + private Integer sessionAffinityTtlSeconds; + + /* + * Defines the Web Application Firewall policy for each host (if + * applicable) + */ + @JsonProperty(value = "webApplicationFirewallPolicyLink") + private FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink; + + /** + * Get the hostname property: The host name of the frontendEndpoint. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the frontendEndpoint. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the FrontendEndpointUpdateParameters object itself. + */ + public FrontendEndpointUpdateParameters withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the sessionAffinityEnabledState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityEnabledState value. + */ + public SessionAffinityEnabledState sessionAffinityEnabledState() { + return this.sessionAffinityEnabledState; + } + + /** + * Set the sessionAffinityEnabledState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @param sessionAffinityEnabledState the sessionAffinityEnabledState value to set. + * @return the FrontendEndpointUpdateParameters object itself. + */ + public FrontendEndpointUpdateParameters withSessionAffinityEnabledState( + SessionAffinityEnabledState sessionAffinityEnabledState) { + this.sessionAffinityEnabledState = sessionAffinityEnabledState; + return this; + } + + /** + * Get the sessionAffinityTtlSeconds property: UNUSED. This field will be ignored. The TTL to use in seconds for + * session affinity, if applicable. + * + * @return the sessionAffinityTtlSeconds value. + */ + public Integer sessionAffinityTtlSeconds() { + return this.sessionAffinityTtlSeconds; + } + + /** + * Set the sessionAffinityTtlSeconds property: UNUSED. This field will be ignored. The TTL to use in seconds for + * session affinity, if applicable. + * + * @param sessionAffinityTtlSeconds the sessionAffinityTtlSeconds value to set. + * @return the FrontendEndpointUpdateParameters object itself. + */ + public FrontendEndpointUpdateParameters withSessionAffinityTtlSeconds(Integer sessionAffinityTtlSeconds) { + this.sessionAffinityTtlSeconds = sessionAffinityTtlSeconds; + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for each host (if + * applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.webApplicationFirewallPolicyLink; + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for each host (if + * applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the FrontendEndpointUpdateParameters object itself. + */ + public FrontendEndpointUpdateParameters withWebApplicationFirewallPolicyLink( + FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + this.webApplicationFirewallPolicyLink = webApplicationFirewallPolicyLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webApplicationFirewallPolicyLink() != null) { + webApplicationFirewallPolicyLink().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.java new file mode 100644 index 0000000000000..f03d2e4421fc5 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the Web Application Firewall policy for each host (if applicable). */ +@Fluent +public final class FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink object itself. + */ + public FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpoints.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpoints.java new file mode 100644 index 0000000000000..9683551a0036b --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpoints.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.frontdoor.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 FrontendEndpoints. */ +public interface FrontendEndpoints { + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName); + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list frontend endpoints. + */ + PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName, Context context); + + /** + * Gets a Frontend endpoint with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Frontend endpoint with the specified name within the specified Front Door. + */ + FrontendEndpoint get(String resourceGroupName, String frontDoorName, String frontendEndpointName); + + /** + * Gets a Frontend endpoint with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Frontend endpoint with the specified name within the specified Front Door. + */ + Response getWithResponse( + String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context); + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration); + + /** + * Enables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param customHttpsConfiguration The configuration specifying how to enable HTTPS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableHttps( + String resourceGroupName, + String frontDoorName, + String frontendEndpointName, + CustomHttpsConfiguration customHttpsConfiguration, + Context context); + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disableHttps(String resourceGroupName, String frontDoorName, String frontendEndpointName); + + /** + * Disables a frontendEndpoint for HTTPS traffic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disableHttps(String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointsListResult.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointsListResult.java new file mode 100644 index 0000000000000..335193f46168c --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/FrontendEndpointsListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list frontend endpoints. It contains a list of Frontend endpoint objects and a URL link to + * get the next set of results. + */ +@Fluent +public final class FrontendEndpointsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontendEndpointsListResult.class); + + /* + * List of Frontend endpoints within a Front Door. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of frontend endpoints if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Frontend endpoints within a Front Door. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of frontend endpoints 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 frontend endpoints if there are any. + * + * @param nextLink the nextLink value to set. + * @return the FrontendEndpointsListResult object itself. + */ + public FrontendEndpointsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HeaderAction.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HeaderAction.java new file mode 100644 index 0000000000000..d69c6b2b63991 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HeaderAction.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An action that can manipulate an http header. */ +@Fluent +public final class HeaderAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HeaderAction.class); + + /* + * Which type of manipulation to apply to the header. + */ + @JsonProperty(value = "headerActionType", required = true) + private HeaderActionType headerActionType; + + /* + * The name of the header this action will apply to. + */ + @JsonProperty(value = "headerName", required = true) + private String headerName; + + /* + * The value to update the given header name with. This value is not used + * if the actionType is Delete. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the headerActionType property: Which type of manipulation to apply to the header. + * + * @return the headerActionType value. + */ + public HeaderActionType headerActionType() { + return this.headerActionType; + } + + /** + * Set the headerActionType property: Which type of manipulation to apply to the header. + * + * @param headerActionType the headerActionType value to set. + * @return the HeaderAction object itself. + */ + public HeaderAction withHeaderActionType(HeaderActionType headerActionType) { + this.headerActionType = headerActionType; + return this; + } + + /** + * Get the headerName property: The name of the header this action will apply to. + * + * @return the headerName value. + */ + public String headerName() { + return this.headerName; + } + + /** + * Set the headerName property: The name of the header this action will apply to. + * + * @param headerName the headerName value to set. + * @return the HeaderAction object itself. + */ + public HeaderAction withHeaderName(String headerName) { + this.headerName = headerName; + return this; + } + + /** + * Get the value property: The value to update the given header name with. This value is not used if the actionType + * is Delete. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value to update the given header name with. This value is not used if the actionType + * is Delete. + * + * @param value the value value to set. + * @return the HeaderAction object itself. + */ + public HeaderAction withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (headerActionType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property headerActionType in model HeaderAction")); + } + if (headerName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property headerName in model HeaderAction")); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HeaderActionType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HeaderActionType.java new file mode 100644 index 0000000000000..e7ce5883b741e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HeaderActionType.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HeaderActionType. */ +public final class HeaderActionType extends ExpandableStringEnum { + /** Static value Append for HeaderActionType. */ + public static final HeaderActionType APPEND = fromString("Append"); + + /** Static value Delete for HeaderActionType. */ + public static final HeaderActionType DELETE = fromString("Delete"); + + /** Static value Overwrite for HeaderActionType. */ + public static final HeaderActionType OVERWRITE = fromString("Overwrite"); + + /** + * Creates or finds a HeaderActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HeaderActionType. + */ + @JsonCreator + public static HeaderActionType fromString(String name) { + return fromString(name, HeaderActionType.class); + } + + /** @return known HeaderActionType values. */ + public static Collection values() { + return values(HeaderActionType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeEnabled.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeEnabled.java new file mode 100644 index 0000000000000..a57518cfe951f --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeEnabled.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HealthProbeEnabled. */ +public final class HealthProbeEnabled extends ExpandableStringEnum { + /** Static value Enabled for HealthProbeEnabled. */ + public static final HealthProbeEnabled ENABLED = fromString("Enabled"); + + /** Static value Disabled for HealthProbeEnabled. */ + public static final HealthProbeEnabled DISABLED = fromString("Disabled"); + + /** + * Creates or finds a HealthProbeEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthProbeEnabled. + */ + @JsonCreator + public static HealthProbeEnabled fromString(String name) { + return fromString(name, HealthProbeEnabled.class); + } + + /** @return known HealthProbeEnabled values. */ + public static Collection values() { + return values(HealthProbeEnabled.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsModel.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsModel.java new file mode 100644 index 0000000000000..f40967b204cd1 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsModel.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Load balancing settings for a backend pool. */ +@JsonFlatten +@Fluent +public class HealthProbeSettingsModel extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HealthProbeSettingsModel.class); + + /* + * Resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The path to use for the health probe. Default is / + */ + @JsonProperty(value = "properties.path") + private String path; + + /* + * Protocol scheme to use for this probe + */ + @JsonProperty(value = "properties.protocol") + private FrontDoorProtocol protocol; + + /* + * The number of seconds between health probes. + */ + @JsonProperty(value = "properties.intervalInSeconds") + private Integer intervalInSeconds; + + /* + * Configures which HTTP method to use to probe the backends defined under + * backendPools. + */ + @JsonProperty(value = "properties.healthProbeMethod") + private FrontDoorHealthProbeMethod healthProbeMethod; + + /* + * Whether to enable health probes to be made against backends defined + * under backendPools. Health probes can only be disabled if there is a + * single enabled backend in single enabled backend pool. + */ + @JsonProperty(value = "properties.enabledState") + private HealthProbeEnabled enabledState; + + /* + * Resource status. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the HealthProbeSettingsModel object itself. + */ + public HealthProbeSettingsModel withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the path property: The path to use for the health probe. Default is /. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path to use for the health probe. Default is /. + * + * @param path the path value to set. + * @return the HealthProbeSettingsModel object itself. + */ + public HealthProbeSettingsModel withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the protocol property: Protocol scheme to use for this probe. + * + * @return the protocol value. + */ + public FrontDoorProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol scheme to use for this probe. + * + * @param protocol the protocol value to set. + * @return the HealthProbeSettingsModel object itself. + */ + public HealthProbeSettingsModel withProtocol(FrontDoorProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the intervalInSeconds property: The number of seconds between health probes. + * + * @return the intervalInSeconds value. + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the intervalInSeconds property: The number of seconds between health probes. + * + * @param intervalInSeconds the intervalInSeconds value to set. + * @return the HealthProbeSettingsModel object itself. + */ + public HealthProbeSettingsModel withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the healthProbeMethod property: Configures which HTTP method to use to probe the backends defined under + * backendPools. + * + * @return the healthProbeMethod value. + */ + public FrontDoorHealthProbeMethod healthProbeMethod() { + return this.healthProbeMethod; + } + + /** + * Set the healthProbeMethod property: Configures which HTTP method to use to probe the backends defined under + * backendPools. + * + * @param healthProbeMethod the healthProbeMethod value to set. + * @return the HealthProbeSettingsModel object itself. + */ + public HealthProbeSettingsModel withHealthProbeMethod(FrontDoorHealthProbeMethod healthProbeMethod) { + this.healthProbeMethod = healthProbeMethod; + 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 HealthProbeEnabled 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 HealthProbeSettingsModel object itself. + */ + public HealthProbeSettingsModel withEnabledState(HealthProbeEnabled enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public HealthProbeSettingsModel withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsProperties.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsProperties.java new file mode 100644 index 0000000000000..e8a115abe1322 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsProperties.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.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties required to create a health probe settings. */ +@Immutable +public final class HealthProbeSettingsProperties extends HealthProbeSettingsUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HealthProbeSettingsProperties.class); + + /* + * Resource status. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public HealthProbeSettingsProperties withPath(String path) { + super.withPath(path); + return this; + } + + /** {@inheritDoc} */ + @Override + public HealthProbeSettingsProperties withProtocol(FrontDoorProtocol protocol) { + super.withProtocol(protocol); + return this; + } + + /** {@inheritDoc} */ + @Override + public HealthProbeSettingsProperties withIntervalInSeconds(Integer intervalInSeconds) { + super.withIntervalInSeconds(intervalInSeconds); + return this; + } + + /** {@inheritDoc} */ + @Override + public HealthProbeSettingsProperties withHealthProbeMethod(FrontDoorHealthProbeMethod healthProbeMethod) { + super.withHealthProbeMethod(healthProbeMethod); + return this; + } + + /** {@inheritDoc} */ + @Override + public HealthProbeSettingsProperties withEnabledState(HealthProbeEnabled enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsUpdateParameters.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsUpdateParameters.java new file mode 100644 index 0000000000000..f5d2fffa48dfe --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/HealthProbeSettingsUpdateParameters.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** L7 health probe settings for a backend pool. */ +@Fluent +public class HealthProbeSettingsUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HealthProbeSettingsUpdateParameters.class); + + /* + * The path to use for the health probe. Default is / + */ + @JsonProperty(value = "path") + private String path; + + /* + * Protocol scheme to use for this probe + */ + @JsonProperty(value = "protocol") + private FrontDoorProtocol protocol; + + /* + * The number of seconds between health probes. + */ + @JsonProperty(value = "intervalInSeconds") + private Integer intervalInSeconds; + + /* + * Configures which HTTP method to use to probe the backends defined under + * backendPools. + */ + @JsonProperty(value = "healthProbeMethod") + private FrontDoorHealthProbeMethod healthProbeMethod; + + /* + * Whether to enable health probes to be made against backends defined + * under backendPools. Health probes can only be disabled if there is a + * single enabled backend in single enabled backend pool. + */ + @JsonProperty(value = "enabledState") + private HealthProbeEnabled enabledState; + + /** + * Get the path property: The path to use for the health probe. Default is /. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path to use for the health probe. Default is /. + * + * @param path the path value to set. + * @return the HealthProbeSettingsUpdateParameters object itself. + */ + public HealthProbeSettingsUpdateParameters withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the protocol property: Protocol scheme to use for this probe. + * + * @return the protocol value. + */ + public FrontDoorProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol scheme to use for this probe. + * + * @param protocol the protocol value to set. + * @return the HealthProbeSettingsUpdateParameters object itself. + */ + public HealthProbeSettingsUpdateParameters withProtocol(FrontDoorProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the intervalInSeconds property: The number of seconds between health probes. + * + * @return the intervalInSeconds value. + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the intervalInSeconds property: The number of seconds between health probes. + * + * @param intervalInSeconds the intervalInSeconds value to set. + * @return the HealthProbeSettingsUpdateParameters object itself. + */ + public HealthProbeSettingsUpdateParameters withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the healthProbeMethod property: Configures which HTTP method to use to probe the backends defined under + * backendPools. + * + * @return the healthProbeMethod value. + */ + public FrontDoorHealthProbeMethod healthProbeMethod() { + return this.healthProbeMethod; + } + + /** + * Set the healthProbeMethod property: Configures which HTTP method to use to probe the backends defined under + * backendPools. + * + * @param healthProbeMethod the healthProbeMethod value to set. + * @return the HealthProbeSettingsUpdateParameters object itself. + */ + public HealthProbeSettingsUpdateParameters withHealthProbeMethod(FrontDoorHealthProbeMethod healthProbeMethod) { + this.healthProbeMethod = healthProbeMethod; + 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 HealthProbeEnabled 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 HealthProbeSettingsUpdateParameters object itself. + */ + public HealthProbeSettingsUpdateParameters withEnabledState(HealthProbeEnabled enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/KeyVaultCertificateSourceParametersVault.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/KeyVaultCertificateSourceParametersVault.java new file mode 100644 index 0000000000000..cb709d46d2c5e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/KeyVaultCertificateSourceParametersVault.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Key Vault containing the SSL certificate. */ +@Fluent +public final class KeyVaultCertificateSourceParametersVault { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultCertificateSourceParametersVault.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the KeyVaultCertificateSourceParametersVault object itself. + */ + public KeyVaultCertificateSourceParametersVault withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyMetric.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyMetric.java new file mode 100644 index 0000000000000..1594e61282f40 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyMetric.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the properties of a latency metric used in the latency scorecard. */ +@Immutable +public final class LatencyMetric { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LatencyMetric.class); + + /* + * The name of the Latency Metric + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The end time of the Latency Scorecard in UTC + */ + @JsonProperty(value = "endDateTimeUTC", access = JsonProperty.Access.WRITE_ONLY) + private String endDateTimeUtc; + + /* + * The metric value of the A endpoint + */ + @JsonProperty(value = "aValue", access = JsonProperty.Access.WRITE_ONLY) + private Float aValue; + + /* + * The metric value of the B endpoint + */ + @JsonProperty(value = "bValue", access = JsonProperty.Access.WRITE_ONLY) + private Float bValue; + + /* + * The difference in value between endpoint A and B + */ + @JsonProperty(value = "delta", access = JsonProperty.Access.WRITE_ONLY) + private Float delta; + + /* + * The percent difference between endpoint A and B + */ + @JsonProperty(value = "deltaPercent", access = JsonProperty.Access.WRITE_ONLY) + private Float deltaPercent; + + /* + * The lower end of the 95% confidence interval for endpoint A + */ + @JsonProperty(value = "aCLower95CI", access = JsonProperty.Access.WRITE_ONLY) + private Float aCLower95CI; + + /* + * The upper end of the 95% confidence interval for endpoint A + */ + @JsonProperty(value = "aHUpper95CI", access = JsonProperty.Access.WRITE_ONLY) + private Float aHUpper95CI; + + /* + * The lower end of the 95% confidence interval for endpoint B + */ + @JsonProperty(value = "bCLower95CI", access = JsonProperty.Access.WRITE_ONLY) + private Float bCLower95CI; + + /* + * The upper end of the 95% confidence interval for endpoint B + */ + @JsonProperty(value = "bUpper95CI", access = JsonProperty.Access.WRITE_ONLY) + private Float bUpper95CI; + + /** + * Get the name property: The name of the Latency Metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the endDateTimeUtc property: The end time of the Latency Scorecard in UTC. + * + * @return the endDateTimeUtc value. + */ + public String endDateTimeUtc() { + return this.endDateTimeUtc; + } + + /** + * Get the aValue property: The metric value of the A endpoint. + * + * @return the aValue value. + */ + public Float aValue() { + return this.aValue; + } + + /** + * Get the bValue property: The metric value of the B endpoint. + * + * @return the bValue value. + */ + public Float bValue() { + return this.bValue; + } + + /** + * Get the delta property: The difference in value between endpoint A and B. + * + * @return the delta value. + */ + public Float delta() { + return this.delta; + } + + /** + * Get the deltaPercent property: The percent difference between endpoint A and B. + * + * @return the deltaPercent value. + */ + public Float deltaPercent() { + return this.deltaPercent; + } + + /** + * Get the aCLower95CI property: The lower end of the 95% confidence interval for endpoint A. + * + * @return the aCLower95CI value. + */ + public Float aCLower95CI() { + return this.aCLower95CI; + } + + /** + * Get the aHUpper95CI property: The upper end of the 95% confidence interval for endpoint A. + * + * @return the aHUpper95CI value. + */ + public Float aHUpper95CI() { + return this.aHUpper95CI; + } + + /** + * Get the bCLower95CI property: The lower end of the 95% confidence interval for endpoint B. + * + * @return the bCLower95CI value. + */ + public Float bCLower95CI() { + return this.bCLower95CI; + } + + /** + * Get the bUpper95CI property: The upper end of the 95% confidence interval for endpoint B. + * + * @return the bUpper95CI value. + */ + public Float bUpper95CI() { + return this.bUpper95CI; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyScorecard.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyScorecard.java new file mode 100644 index 0000000000000..2f97bb4ca6f78 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyScorecard.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.frontdoor.models; + +import com.azure.resourcemanager.frontdoor.fluent.models.LatencyScorecardInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of LatencyScorecard. */ +public interface LatencyScorecard { + /** + * 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 idPropertiesId property: The unique identifier of the Latency Scorecard. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the namePropertiesName property: The name of the Latency Scorecard. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the description property: The description of the Latency Scorecard. + * + * @return the description value. + */ + String description(); + + /** + * Gets the endpointA property: The A endpoint in the scorecard. + * + * @return the endpointA value. + */ + String endpointA(); + + /** + * Gets the endpointB property: The B endpoint in the scorecard. + * + * @return the endpointB value. + */ + String endpointB(); + + /** + * Gets the startDateTimeUtc property: The start time of the Latency Scorecard in UTC. + * + * @return the startDateTimeUtc value. + */ + OffsetDateTime startDateTimeUtc(); + + /** + * Gets the endDateTimeUtc property: The end time of the Latency Scorecard in UTC. + * + * @return the endDateTimeUtc value. + */ + OffsetDateTime endDateTimeUtc(); + + /** + * Gets the country property: The country associated with the Latency Scorecard. Values are country ISO codes as + * specified here- https://www.iso.org/iso-3166-country-codes.html. + * + * @return the country value. + */ + String country(); + + /** + * Gets the latencyMetrics property: The latency metrics of the Latency Scorecard. + * + * @return the latencyMetrics value. + */ + List latencyMetrics(); + + /** + * Gets the inner com.azure.resourcemanager.frontdoor.fluent.models.LatencyScorecardInner object. + * + * @return the inner object. + */ + LatencyScorecardInner innerModel(); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyScorecardAggregationInterval.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyScorecardAggregationInterval.java new file mode 100644 index 0000000000000..b13a1e2ee5a7e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LatencyScorecardAggregationInterval.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LatencyScorecardAggregationInterval. */ +public final class LatencyScorecardAggregationInterval + extends ExpandableStringEnum { + /** Static value Daily for LatencyScorecardAggregationInterval. */ + public static final LatencyScorecardAggregationInterval DAILY = fromString("Daily"); + + /** Static value Weekly for LatencyScorecardAggregationInterval. */ + public static final LatencyScorecardAggregationInterval WEEKLY = fromString("Weekly"); + + /** Static value Monthly for LatencyScorecardAggregationInterval. */ + public static final LatencyScorecardAggregationInterval MONTHLY = fromString("Monthly"); + + /** + * Creates or finds a LatencyScorecardAggregationInterval from its string representation. + * + * @param name a name to look for. + * @return the corresponding LatencyScorecardAggregationInterval. + */ + @JsonCreator + public static LatencyScorecardAggregationInterval fromString(String name) { + return fromString(name, LatencyScorecardAggregationInterval.class); + } + + /** @return known LatencyScorecardAggregationInterval values. */ + public static Collection values() { + return values(LatencyScorecardAggregationInterval.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsModel.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsModel.java new file mode 100644 index 0000000000000..768ad4e464aca --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsModel.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Load balancing settings for a backend pool. */ +@JsonFlatten +@Fluent +public class LoadBalancingSettingsModel extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingSettingsModel.class); + + /* + * Resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The number of samples to consider for load balancing decisions + */ + @JsonProperty(value = "properties.sampleSize") + private Integer sampleSize; + + /* + * The number of samples within the sample period that must succeed + */ + @JsonProperty(value = "properties.successfulSamplesRequired") + private Integer successfulSamplesRequired; + + /* + * The additional latency in milliseconds for probes to fall into the + * lowest latency bucket + */ + @JsonProperty(value = "properties.additionalLatencyMilliseconds") + private Integer additionalLatencyMilliseconds; + + /* + * Resource status. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the LoadBalancingSettingsModel object itself. + */ + public LoadBalancingSettingsModel withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * 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 LoadBalancingSettingsModel object itself. + */ + public LoadBalancingSettingsModel 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 LoadBalancingSettingsModel object itself. + */ + public LoadBalancingSettingsModel withSuccessfulSamplesRequired(Integer successfulSamplesRequired) { + this.successfulSamplesRequired = successfulSamplesRequired; + return this; + } + + /** + * Get the additionalLatencyMilliseconds property: The additional latency in milliseconds for probes to fall into + * the lowest latency bucket. + * + * @return the additionalLatencyMilliseconds value. + */ + public Integer additionalLatencyMilliseconds() { + return this.additionalLatencyMilliseconds; + } + + /** + * Set the additionalLatencyMilliseconds property: The additional latency in milliseconds for probes to fall into + * the lowest latency bucket. + * + * @param additionalLatencyMilliseconds the additionalLatencyMilliseconds value to set. + * @return the LoadBalancingSettingsModel object itself. + */ + public LoadBalancingSettingsModel withAdditionalLatencyMilliseconds(Integer additionalLatencyMilliseconds) { + this.additionalLatencyMilliseconds = additionalLatencyMilliseconds; + return this; + } + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancingSettingsModel withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsProperties.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsProperties.java new file mode 100644 index 0000000000000..b175860e5e59c --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsProperties.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.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties required to create load balancing settings. */ +@Immutable +public final class LoadBalancingSettingsProperties extends LoadBalancingSettingsUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingSettingsProperties.class); + + /* + * Resource status. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancingSettingsProperties withSampleSize(Integer sampleSize) { + super.withSampleSize(sampleSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancingSettingsProperties withSuccessfulSamplesRequired(Integer successfulSamplesRequired) { + super.withSuccessfulSamplesRequired(successfulSamplesRequired); + return this; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancingSettingsProperties withAdditionalLatencyMilliseconds(Integer additionalLatencyMilliseconds) { + super.withAdditionalLatencyMilliseconds(additionalLatencyMilliseconds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsUpdateParameters.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsUpdateParameters.java new file mode 100644 index 0000000000000..3355969513b97 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/LoadBalancingSettingsUpdateParameters.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Round-Robin load balancing settings for a backend pool. */ +@Fluent +public class LoadBalancingSettingsUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingSettingsUpdateParameters.class); + + /* + * The number of samples to consider for load balancing decisions + */ + @JsonProperty(value = "sampleSize") + private Integer sampleSize; + + /* + * The number of samples within the sample period that must succeed + */ + @JsonProperty(value = "successfulSamplesRequired") + private Integer successfulSamplesRequired; + + /* + * The additional latency in milliseconds for probes to fall into the + * lowest latency bucket + */ + @JsonProperty(value = "additionalLatencyMilliseconds") + private Integer additionalLatencyMilliseconds; + + /** + * 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 LoadBalancingSettingsUpdateParameters object itself. + */ + public LoadBalancingSettingsUpdateParameters 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 LoadBalancingSettingsUpdateParameters object itself. + */ + public LoadBalancingSettingsUpdateParameters withSuccessfulSamplesRequired(Integer successfulSamplesRequired) { + this.successfulSamplesRequired = successfulSamplesRequired; + return this; + } + + /** + * Get the additionalLatencyMilliseconds property: The additional latency in milliseconds for probes to fall into + * the lowest latency bucket. + * + * @return the additionalLatencyMilliseconds value. + */ + public Integer additionalLatencyMilliseconds() { + return this.additionalLatencyMilliseconds; + } + + /** + * Set the additionalLatencyMilliseconds property: The additional latency in milliseconds for probes to fall into + * the lowest latency bucket. + * + * @param additionalLatencyMilliseconds the additionalLatencyMilliseconds value to set. + * @return the LoadBalancingSettingsUpdateParameters object itself. + */ + public LoadBalancingSettingsUpdateParameters withAdditionalLatencyMilliseconds( + Integer additionalLatencyMilliseconds) { + this.additionalLatencyMilliseconds = additionalLatencyMilliseconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleDefinition.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleDefinition.java new file mode 100644 index 0000000000000..48b63e17144ed --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleDefinition.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.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a managed rule definition. */ +@Immutable +public final class ManagedRuleDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleDefinition.class); + + /* + * Identifier for the managed rule. + */ + @JsonProperty(value = "ruleId", access = JsonProperty.Access.WRITE_ONLY) + private String ruleId; + + /* + * Describes the default state for the managed rule. + */ + @JsonProperty(value = "defaultState", access = JsonProperty.Access.WRITE_ONLY) + private ManagedRuleEnabledState defaultState; + + /* + * Describes the default action to be applied when the managed rule + * matches. + */ + @JsonProperty(value = "defaultAction", access = JsonProperty.Access.WRITE_ONLY) + private ActionType defaultAction; + + /* + * Describes the functionality of the managed rule. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the ruleId property: Identifier for the managed rule. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Get the defaultState property: Describes the default state for the managed rule. + * + * @return the defaultState value. + */ + public ManagedRuleEnabledState defaultState() { + return this.defaultState; + } + + /** + * Get the defaultAction property: Describes the default action to be applied when the managed rule matches. + * + * @return the defaultAction value. + */ + public ActionType defaultAction() { + return this.defaultAction; + } + + /** + * Get the description property: Describes the functionality of the managed rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleEnabledState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleEnabledState.java new file mode 100644 index 0000000000000..1debf5c5052c6 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleEnabledState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedRuleEnabledState. */ +public final class ManagedRuleEnabledState extends ExpandableStringEnum { + /** Static value Disabled for ManagedRuleEnabledState. */ + public static final ManagedRuleEnabledState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ManagedRuleEnabledState. */ + public static final ManagedRuleEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ManagedRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedRuleEnabledState. + */ + @JsonCreator + public static ManagedRuleEnabledState fromString(String name) { + return fromString(name, ManagedRuleEnabledState.class); + } + + /** @return known ManagedRuleEnabledState values. */ + public static Collection values() { + return values(ManagedRuleEnabledState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusion.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusion.java new file mode 100644 index 0000000000000..9f642e8768f9a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusion.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Exclude variables from managed rule evaluation. */ +@Fluent +public final class ManagedRuleExclusion { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleExclusion.class); + + /* + * The variable type to be excluded. + */ + @JsonProperty(value = "matchVariable", required = true) + private ManagedRuleExclusionMatchVariable matchVariable; + + /* + * Comparison operator to apply to the selector when specifying which + * elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selectorMatchOperator", required = true) + private ManagedRuleExclusionSelectorMatchOperator selectorMatchOperator; + + /* + * Selector value for which elements in the collection this exclusion + * applies to. + */ + @JsonProperty(value = "selector", required = true) + private String selector; + + /** + * Get the matchVariable property: The variable type to be excluded. + * + * @return the matchVariable value. + */ + public ManagedRuleExclusionMatchVariable matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: The variable type to be excluded. + * + * @param matchVariable the matchVariable value to set. + * @return the ManagedRuleExclusion object itself. + */ + public ManagedRuleExclusion withMatchVariable(ManagedRuleExclusionMatchVariable matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get the selectorMatchOperator property: Comparison operator to apply to the selector when specifying which + * elements in the collection this exclusion applies to. + * + * @return the selectorMatchOperator value. + */ + public ManagedRuleExclusionSelectorMatchOperator selectorMatchOperator() { + return this.selectorMatchOperator; + } + + /** + * Set the selectorMatchOperator property: Comparison operator to apply to the selector when specifying which + * elements in the collection this exclusion applies to. + * + * @param selectorMatchOperator the selectorMatchOperator value to set. + * @return the ManagedRuleExclusion object itself. + */ + public ManagedRuleExclusion withSelectorMatchOperator( + ManagedRuleExclusionSelectorMatchOperator selectorMatchOperator) { + this.selectorMatchOperator = selectorMatchOperator; + return this; + } + + /** + * Get the selector property: Selector value for which elements in the collection this exclusion applies to. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: Selector value for which elements in the collection this exclusion applies to. + * + * @param selector the selector value to set. + * @return the ManagedRuleExclusion object itself. + */ + public ManagedRuleExclusion withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchVariable in model ManagedRuleExclusion")); + } + if (selectorMatchOperator() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectorMatchOperator in model ManagedRuleExclusion")); + } + if (selector() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property selector in model ManagedRuleExclusion")); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusionMatchVariable.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusionMatchVariable.java new file mode 100644 index 0000000000000..955b1ac8ef946 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusionMatchVariable.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedRuleExclusionMatchVariable. */ +public final class ManagedRuleExclusionMatchVariable extends ExpandableStringEnum { + /** Static value RequestHeaderNames for ManagedRuleExclusionMatchVariable. */ + public static final ManagedRuleExclusionMatchVariable REQUEST_HEADER_NAMES = fromString("RequestHeaderNames"); + + /** Static value RequestCookieNames for ManagedRuleExclusionMatchVariable. */ + public static final ManagedRuleExclusionMatchVariable REQUEST_COOKIE_NAMES = fromString("RequestCookieNames"); + + /** Static value QueryStringArgNames for ManagedRuleExclusionMatchVariable. */ + public static final ManagedRuleExclusionMatchVariable QUERY_STRING_ARG_NAMES = fromString("QueryStringArgNames"); + + /** Static value RequestBodyPostArgNames for ManagedRuleExclusionMatchVariable. */ + public static final ManagedRuleExclusionMatchVariable REQUEST_BODY_POST_ARG_NAMES = + fromString("RequestBodyPostArgNames"); + + /** Static value RequestBodyJsonArgNames for ManagedRuleExclusionMatchVariable. */ + public static final ManagedRuleExclusionMatchVariable REQUEST_BODY_JSON_ARG_NAMES = + fromString("RequestBodyJsonArgNames"); + + /** + * Creates or finds a ManagedRuleExclusionMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedRuleExclusionMatchVariable. + */ + @JsonCreator + public static ManagedRuleExclusionMatchVariable fromString(String name) { + return fromString(name, ManagedRuleExclusionMatchVariable.class); + } + + /** @return known ManagedRuleExclusionMatchVariable values. */ + public static Collection values() { + return values(ManagedRuleExclusionMatchVariable.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusionSelectorMatchOperator.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusionSelectorMatchOperator.java new file mode 100644 index 0000000000000..8f879f5082aeb --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleExclusionSelectorMatchOperator.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedRuleExclusionSelectorMatchOperator. */ +public final class ManagedRuleExclusionSelectorMatchOperator + extends ExpandableStringEnum { + /** Static value Equals for ManagedRuleExclusionSelectorMatchOperator. */ + public static final ManagedRuleExclusionSelectorMatchOperator EQUALS = fromString("Equals"); + + /** Static value Contains for ManagedRuleExclusionSelectorMatchOperator. */ + public static final ManagedRuleExclusionSelectorMatchOperator CONTAINS = fromString("Contains"); + + /** Static value StartsWith for ManagedRuleExclusionSelectorMatchOperator. */ + public static final ManagedRuleExclusionSelectorMatchOperator STARTS_WITH = fromString("StartsWith"); + + /** Static value EndsWith for ManagedRuleExclusionSelectorMatchOperator. */ + public static final ManagedRuleExclusionSelectorMatchOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value EqualsAny for ManagedRuleExclusionSelectorMatchOperator. */ + public static final ManagedRuleExclusionSelectorMatchOperator EQUALS_ANY = fromString("EqualsAny"); + + /** + * Creates or finds a ManagedRuleExclusionSelectorMatchOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedRuleExclusionSelectorMatchOperator. + */ + @JsonCreator + public static ManagedRuleExclusionSelectorMatchOperator fromString(String name) { + return fromString(name, ManagedRuleExclusionSelectorMatchOperator.class); + } + + /** @return known ManagedRuleExclusionSelectorMatchOperator values. */ + public static Collection values() { + return values(ManagedRuleExclusionSelectorMatchOperator.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleGroupDefinition.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleGroupDefinition.java new file mode 100644 index 0000000000000..a176a4a27ed17 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleGroupDefinition.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a managed rule group. */ +@Immutable +public final class ManagedRuleGroupDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleGroupDefinition.class); + + /* + * Name of the managed rule group. + */ + @JsonProperty(value = "ruleGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String ruleGroupName; + + /* + * Description of the managed rule group. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * List of rules within the managed rule group. + */ + @JsonProperty(value = "rules", access = JsonProperty.Access.WRITE_ONLY) + private List rules; + + /** + * Get the ruleGroupName property: Name of the managed rule group. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Get the description property: Description of the managed rule group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the rules property: List of rules within the managed rule group. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleGroupOverride.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleGroupOverride.java new file mode 100644 index 0000000000000..2bc4ba7d11cfc --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleGroupOverride.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleGroupOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleGroupOverride.class); + + /* + * Describes the managed rule group to override. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * Describes the exclusions that are applied to all rules in the group. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /* + * List of rules that will be disabled. If none specified, all rules in the + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the ruleGroupName property: Describes the managed rule group to override. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: Describes the managed rule group 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 exclusions property: Describes the exclusions that are applied to all rules in the group. + * + * @return the exclusions value. + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set the exclusions property: Describes the exclusions that are applied to all rules in the group. + * + * @param exclusions the exclusions value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withExclusions(List exclusions) { + this.exclusions = exclusions; + return this; + } + + /** + * Get the rules property: List of rules that will be disabled. If none specified, all rules in the group will be + * disabled. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules that will be disabled. If none specified, all rules in the group will be + * disabled. + * + * @param rules the rules value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroupName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model ManagedRuleGroupOverride")); + } + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleOverride.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleOverride.java new file mode 100644 index 0000000000000..db6fede052d3c --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleOverride.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleOverride.class); + + /* + * Identifier for the managed rule. + */ + @JsonProperty(value = "ruleId", required = true) + private String ruleId; + + /* + * Describes if the managed rule is in enabled or disabled state. Defaults + * to Disabled if not specified. + */ + @JsonProperty(value = "enabledState") + private ManagedRuleEnabledState enabledState; + + /* + * Describes the override action to be applied when rule matches. + */ + @JsonProperty(value = "action") + private ActionType action; + + /* + * Describes the exclusions that are applied to this specific rule. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /** + * 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; + } + + /** + * Get the exclusions property: Describes the exclusions that are applied to this specific rule. + * + * @return the exclusions value. + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set the exclusions property: Describes the exclusions that are applied to this specific rule. + * + * @param exclusions the exclusions value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withExclusions(List exclusions) { + this.exclusions = exclusions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleId in model ManagedRuleOverride")); + } + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSet.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSet.java new file mode 100644 index 0000000000000..f4189ef3e9bb2 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSet.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule set. */ +@Fluent +public final class ManagedRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSet.class); + + /* + * Defines the rule set type to use. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * Defines the action to take when a managed rule set score threshold is + * met. + */ + @JsonProperty(value = "ruleSetAction") + private ManagedRuleSetActionType ruleSetAction; + + /* + * Describes the exclusions that are applied to all rules in the set. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /* + * Defines the rule group overrides to apply to the rule set. + */ + @JsonProperty(value = "ruleGroupOverrides") + private List ruleGroupOverrides; + + /** + * Get the ruleSetType property: Defines the rule set type to use. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the ruleSetType property: Defines the rule set type to use. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the ruleSetVersion property: Defines the version of the rule set to use. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the ruleSetVersion property: Defines the version of the rule set to use. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the ruleSetAction property: Defines the action to take when a managed rule set score threshold is met. + * + * @return the ruleSetAction value. + */ + public ManagedRuleSetActionType ruleSetAction() { + return this.ruleSetAction; + } + + /** + * Set the ruleSetAction property: Defines the action to take when a managed rule set score threshold is met. + * + * @param ruleSetAction the ruleSetAction value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetAction(ManagedRuleSetActionType ruleSetAction) { + this.ruleSetAction = ruleSetAction; + return this; + } + + /** + * Get the exclusions property: Describes the exclusions that are applied to all rules in the set. + * + * @return the exclusions value. + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set the exclusions property: Describes the exclusions that are applied to all rules in the set. + * + * @param exclusions the exclusions value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withExclusions(List exclusions) { + this.exclusions = exclusions; + return this; + } + + /** + * Get the ruleGroupOverrides property: Defines the rule group overrides to apply to the rule set. + * + * @return the ruleGroupOverrides value. + */ + public List ruleGroupOverrides() { + return this.ruleGroupOverrides; + } + + /** + * Set the ruleGroupOverrides property: Defines the rule group overrides to apply to the rule set. + * + * @param ruleGroupOverrides the ruleGroupOverrides value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleGroupOverrides(List ruleGroupOverrides) { + this.ruleGroupOverrides = ruleGroupOverrides; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleSetType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetType in model ManagedRuleSet")); + } + if (ruleSetVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetVersion in model ManagedRuleSet")); + } + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + if (ruleGroupOverrides() != null) { + ruleGroupOverrides().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetActionType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetActionType.java new file mode 100644 index 0000000000000..d187d503639cb --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetActionType.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedRuleSetActionType. */ +public final class ManagedRuleSetActionType extends ExpandableStringEnum { + /** Static value Block for ManagedRuleSetActionType. */ + public static final ManagedRuleSetActionType BLOCK = fromString("Block"); + + /** Static value Log for ManagedRuleSetActionType. */ + public static final ManagedRuleSetActionType LOG = fromString("Log"); + + /** Static value Redirect for ManagedRuleSetActionType. */ + public static final ManagedRuleSetActionType REDIRECT = fromString("Redirect"); + + /** + * Creates or finds a ManagedRuleSetActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedRuleSetActionType. + */ + @JsonCreator + public static ManagedRuleSetActionType fromString(String name) { + return fromString(name, ManagedRuleSetActionType.class); + } + + /** @return known ManagedRuleSetActionType values. */ + public static Collection values() { + return values(ManagedRuleSetActionType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetDefinition.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetDefinition.java new file mode 100644 index 0000000000000..7863549bae8db --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetDefinition.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.frontdoor.models; + +import com.azure.resourcemanager.frontdoor.fluent.models.ManagedRuleSetDefinitionInner; +import java.util.List; +import java.util.Map; + +/** 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 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 provisioningState property: Provisioning state of the managed rule set. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the ruleSetId property: Id of the managed rule set. + * + * @return the ruleSetId value. + */ + String ruleSetId(); + + /** + * 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.frontdoor.fluent.models.ManagedRuleSetDefinitionInner object. + * + * @return the inner object. + */ + ManagedRuleSetDefinitionInner innerModel(); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetDefinitionList.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetDefinitionList.java new file mode 100644 index 0000000000000..25d0817b7a234 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetDefinitionList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.ManagedRuleSetDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of managed rule set definitions available for use in a policy. */ +@Fluent +public final class ManagedRuleSetDefinitionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSetDefinitionList.class); + + /* + * List of managed rule set definitions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to retrieve next set of managed rule set definitions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of managed rule set definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to retrieve next set of managed rule set definitions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to retrieve next set of managed rule set definitions. + * + * @param nextLink the nextLink value to set. + * @return the ManagedRuleSetDefinitionList object itself. + */ + public ManagedRuleSetDefinitionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetList.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetList.java new file mode 100644 index 0000000000000..61ccbfe2a5663 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSetList.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the list of managed rule sets for the policy. */ +@Fluent +public final class ManagedRuleSetList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSetList.class); + + /* + * List of rule sets. + */ + @JsonProperty(value = "managedRuleSets") + private List managedRuleSets; + + /** + * Get the managedRuleSets property: List of rule sets. + * + * @return the managedRuleSets value. + */ + public List managedRuleSets() { + return this.managedRuleSets; + } + + /** + * Set the managedRuleSets property: List of rule sets. + * + * @param managedRuleSets the managedRuleSets value to set. + * @return the ManagedRuleSetList object itself. + */ + public ManagedRuleSetList withManagedRuleSets(List managedRuleSets) { + this.managedRuleSets = managedRuleSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedRuleSets() != null) { + managedRuleSets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSets.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSets.java new file mode 100644 index 0000000000000..6e7d070065faf --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ManagedRuleSets.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ManagedRuleSets. */ +public interface ManagedRuleSets { + /** + * Lists all available managed rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + PagedIterable list(); + + /** + * Lists all available managed rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy. + */ + PagedIterable list(Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchCondition.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchCondition.java new file mode 100644 index 0000000000000..779a354295b8e --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchCondition.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Define a match condition. */ +@Fluent +public final class MatchCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MatchCondition.class); + + /* + * Request variable to compare with. + */ + @JsonProperty(value = "matchVariable", required = true) + private MatchVariable matchVariable; + + /* + * Match against a specific key from the QueryString, PostArgs, + * RequestHeader or Cookies variables. Default is null. + */ + @JsonProperty(value = "selector") + private String selector; + + /* + * Comparison type to use for matching with the variable value. + */ + @JsonProperty(value = "operator", required = true) + private Operator operator; + + /* + * Describes if the result of this condition should be negated. + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * List of possible match values. + */ + @JsonProperty(value = "matchValue", required = true) + private List matchValue; + + /* + * List of transforms. + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** + * Get the matchVariable property: Request variable to compare with. + * + * @return the matchVariable value. + */ + public MatchVariable matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: Request variable to compare with. + * + * @param matchVariable the matchVariable value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchVariable(MatchVariable matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get the selector property: Match against a specific key from the QueryString, PostArgs, RequestHeader or Cookies + * variables. Default is null. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: Match against a specific key from the QueryString, PostArgs, RequestHeader or Cookies + * variables. Default is null. + * + * @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: Comparison type to use for matching with the variable value. + * + * @return the operator value. + */ + public Operator operator() { + return this.operator; + } + + /** + * Set the operator property: Comparison type to use for matching with the variable value. + * + * @param operator the operator value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withOperator(Operator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if the result of this condition should be negated. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if the result of this condition should be negated. + * + * @param negateCondition the negateCondition value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValue property: List of possible match values. + * + * @return the matchValue value. + */ + public List matchValue() { + return this.matchValue; + } + + /** + * Set the matchValue property: List of possible match values. + * + * @param matchValue the matchValue value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchValue(List matchValue) { + this.matchValue = matchValue; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchVariable in model MatchCondition")); + } + if (operator() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property operator in model MatchCondition")); + } + if (matchValue() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchValue in model MatchCondition")); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchProcessingBehavior.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchProcessingBehavior.java new file mode 100644 index 0000000000000..bfba5331974a9 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchProcessingBehavior.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MatchProcessingBehavior. */ +public final class MatchProcessingBehavior extends ExpandableStringEnum { + /** Static value Continue for MatchProcessingBehavior. */ + public static final MatchProcessingBehavior CONTINUE = fromString("Continue"); + + /** Static value Stop for MatchProcessingBehavior. */ + public static final MatchProcessingBehavior STOP = fromString("Stop"); + + /** + * Creates or finds a MatchProcessingBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding MatchProcessingBehavior. + */ + @JsonCreator + public static MatchProcessingBehavior fromString(String name) { + return fromString(name, MatchProcessingBehavior.class); + } + + /** @return known MatchProcessingBehavior values. */ + public static Collection values() { + return values(MatchProcessingBehavior.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchVariable.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchVariable.java new file mode 100644 index 0000000000000..5c0c22aff8bab --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MatchVariable.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MatchVariable. */ +public final class MatchVariable extends ExpandableStringEnum { + /** Static value RemoteAddr for MatchVariable. */ + public static final MatchVariable REMOTE_ADDR = fromString("RemoteAddr"); + + /** 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 Cookies for MatchVariable. */ + public static final MatchVariable COOKIES = fromString("Cookies"); + + /** Static value SocketAddr for MatchVariable. */ + public static final MatchVariable SOCKET_ADDR = fromString("SocketAddr"); + + /** + * Creates or finds a MatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding MatchVariable. + */ + @JsonCreator + public static MatchVariable fromString(String name) { + return fromString(name, MatchVariable.class); + } + + /** @return known MatchVariable values. */ + public static Collection values() { + return values(MatchVariable.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MinimumTlsVersion.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MinimumTlsVersion.java new file mode 100644 index 0000000000000..31591be2c36a3 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/MinimumTlsVersion.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MinimumTlsVersion. */ +public final class MinimumTlsVersion extends ExpandableStringEnum { + /** Static value 1.0 for MinimumTlsVersion. */ + public static final MinimumTlsVersion ONE_ZERO = fromString("1.0"); + + /** Static value 1.2 for MinimumTlsVersion. */ + public static final MinimumTlsVersion ONE_TWO = fromString("1.2"); + + /** + * Creates or finds a MinimumTlsVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding MinimumTlsVersion. + */ + @JsonCreator + public static MinimumTlsVersion fromString(String name) { + return fromString(name, MinimumTlsVersion.class); + } + + /** @return known MinimumTlsVersion values. */ + public static Collection values() { + return values(MinimumTlsVersion.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkExperimentProfiles.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkExperimentProfiles.java new file mode 100644 index 0000000000000..48f38c138ac16 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkExperimentProfiles.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.frontdoor.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 NetworkExperimentProfiles. */ +public interface NetworkExperimentProfiles { + /** + * Gets a list of Network Experiment Profiles under a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Network Experiment Profiles under a subscription. + */ + PagedIterable list(); + + /** + * Gets a list of Network Experiment Profiles under a 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 a list of Network Experiment Profiles under a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Network Experiment Profiles within a resource group under a subscription. + * + * @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 a list of Network Experiment Profiles within a resource group under a subscription. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an NetworkExperiment Profile by ProfileName. + */ + Profile getByResourceGroup(String resourceGroupName, String profileName); + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an NetworkExperiment Profile by ProfileName. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String profileName, Context context); + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 NetworkExperiment Profile by ProfileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @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 NetworkExperiment Profile by ProfileName. + */ + Profile getById(String id); + + /** + * Gets an NetworkExperiment Profile by ProfileName. + * + * @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 NetworkExperiment Profile by ProfileName. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an NetworkExperiment Profile by ProfileName. + * + * @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 NetworkExperiment Profile by ProfileName. + * + * @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/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkExperimentResourceState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkExperimentResourceState.java new file mode 100644 index 0000000000000..d860128e084d7 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkExperimentResourceState.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkExperimentResourceState. */ +public final class NetworkExperimentResourceState extends ExpandableStringEnum { + /** Static value Creating for NetworkExperimentResourceState. */ + public static final NetworkExperimentResourceState CREATING = fromString("Creating"); + + /** Static value Enabling for NetworkExperimentResourceState. */ + public static final NetworkExperimentResourceState ENABLING = fromString("Enabling"); + + /** Static value Enabled for NetworkExperimentResourceState. */ + public static final NetworkExperimentResourceState ENABLED = fromString("Enabled"); + + /** Static value Disabling for NetworkExperimentResourceState. */ + public static final NetworkExperimentResourceState DISABLING = fromString("Disabling"); + + /** Static value Disabled for NetworkExperimentResourceState. */ + public static final NetworkExperimentResourceState DISABLED = fromString("Disabled"); + + /** Static value Deleting for NetworkExperimentResourceState. */ + public static final NetworkExperimentResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a NetworkExperimentResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkExperimentResourceState. + */ + @JsonCreator + public static NetworkExperimentResourceState fromString(String name) { + return fromString(name, NetworkExperimentResourceState.class); + } + + /** @return known NetworkExperimentResourceState values. */ + public static Collection values() { + return values(NetworkExperimentResourceState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkOperationStatus.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkOperationStatus.java new file mode 100644 index 0000000000000..502a1d91a840a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/NetworkOperationStatus.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkOperationStatus. */ +public final class NetworkOperationStatus extends ExpandableStringEnum { + /** Static value InProgress for NetworkOperationStatus. */ + public static final NetworkOperationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for NetworkOperationStatus. */ + public static final NetworkOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for NetworkOperationStatus. */ + public static final NetworkOperationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a NetworkOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkOperationStatus. + */ + @JsonCreator + public static NetworkOperationStatus fromString(String name) { + return fromString(name, NetworkOperationStatus.class); + } + + /** @return known NetworkOperationStatus values. */ + public static Collection values() { + return values(NetworkOperationStatus.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Operator.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Operator.java new file mode 100644 index 0000000000000..0cf29f07f5a00 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Operator.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Operator. */ +public final class Operator extends ExpandableStringEnum { + /** Static value Any for Operator. */ + public static final Operator ANY = fromString("Any"); + + /** Static value IPMatch for Operator. */ + public static final Operator IPMATCH = fromString("IPMatch"); + + /** Static value GeoMatch for Operator. */ + public static final Operator GEO_MATCH = fromString("GeoMatch"); + + /** Static value Equal for Operator. */ + public static final Operator EQUAL = fromString("Equal"); + + /** Static value Contains for Operator. */ + public static final Operator CONTAINS = fromString("Contains"); + + /** Static value LessThan for Operator. */ + public static final Operator LESS_THAN = fromString("LessThan"); + + /** Static value GreaterThan for Operator. */ + public static final Operator GREATER_THAN = fromString("GreaterThan"); + + /** Static value LessThanOrEqual for Operator. */ + public static final Operator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThanOrEqual for Operator. */ + public static final Operator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value BeginsWith for Operator. */ + public static final Operator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for Operator. */ + public static final Operator ENDS_WITH = fromString("EndsWith"); + + /** Static value RegEx for Operator. */ + public static final Operator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a Operator from its string representation. + * + * @param name a name to look for. + * @return the corresponding Operator. + */ + @JsonCreator + public static Operator fromString(String name) { + return fromString(name, Operator.class); + } + + /** @return known Operator values. */ + public static Collection values() { + return values(Operator.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Policies.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Policies.java new file mode 100644 index 0000000000000..45e8bf3974a22 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Policies.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.frontdoor.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. + */ + 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. + */ + 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 Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + WebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String policyName); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the Web Application Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 policyName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + WebApplicationFirewallPolicy 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. + */ + 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WebApplicationFirewallPolicy resource. + * + * @param name resource name. + * @return the first stage of the new WebApplicationFirewallPolicy definition. + */ + WebApplicationFirewallPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyEnabledState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyEnabledState.java new file mode 100644 index 0000000000000..a9b615022bc1a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyEnabledState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyEnabledState. */ +public final class PolicyEnabledState extends ExpandableStringEnum { + /** Static value Disabled for PolicyEnabledState. */ + public static final PolicyEnabledState DISABLED = fromString("Disabled"); + + /** Static value Enabled for PolicyEnabledState. */ + public static final PolicyEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a PolicyEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyEnabledState. + */ + @JsonCreator + public static PolicyEnabledState fromString(String name) { + return fromString(name, PolicyEnabledState.class); + } + + /** @return known PolicyEnabledState values. */ + public static Collection values() { + return values(PolicyEnabledState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyMode.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyMode.java new file mode 100644 index 0000000000000..df8d83f4f7e57 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyMode. */ +public final class PolicyMode extends ExpandableStringEnum { + /** Static value Prevention for PolicyMode. */ + public static final PolicyMode PREVENTION = fromString("Prevention"); + + /** Static value Detection for PolicyMode. */ + public static final PolicyMode DETECTION = fromString("Detection"); + + /** + * Creates or finds a PolicyMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyMode. + */ + @JsonCreator + public static PolicyMode fromString(String name) { + return fromString(name, PolicyMode.class); + } + + /** @return known PolicyMode values. */ + public static Collection values() { + return values(PolicyMode.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyRequestBodyCheck.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyRequestBodyCheck.java new file mode 100644 index 0000000000000..de8f7484348c9 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyRequestBodyCheck.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyRequestBodyCheck. */ +public final class PolicyRequestBodyCheck extends ExpandableStringEnum { + /** Static value Disabled for PolicyRequestBodyCheck. */ + public static final PolicyRequestBodyCheck DISABLED = fromString("Disabled"); + + /** Static value Enabled for PolicyRequestBodyCheck. */ + public static final PolicyRequestBodyCheck ENABLED = fromString("Enabled"); + + /** + * Creates or finds a PolicyRequestBodyCheck from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyRequestBodyCheck. + */ + @JsonCreator + public static PolicyRequestBodyCheck fromString(String name) { + return fromString(name, PolicyRequestBodyCheck.class); + } + + /** @return known PolicyRequestBodyCheck values. */ + public static Collection values() { + return values(PolicyRequestBodyCheck.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyResourceState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyResourceState.java new file mode 100644 index 0000000000000..294a103775ae7 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicyResourceState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyResourceState. */ +public final class PolicyResourceState extends ExpandableStringEnum { + /** Static value Creating for PolicyResourceState. */ + public static final PolicyResourceState CREATING = fromString("Creating"); + + /** Static value Enabling for PolicyResourceState. */ + public static final PolicyResourceState ENABLING = fromString("Enabling"); + + /** Static value Enabled for PolicyResourceState. */ + public static final PolicyResourceState ENABLED = fromString("Enabled"); + + /** Static value Disabling for PolicyResourceState. */ + public static final PolicyResourceState DISABLING = fromString("Disabling"); + + /** Static value Disabled for PolicyResourceState. */ + public static final PolicyResourceState DISABLED = fromString("Disabled"); + + /** Static value Deleting for PolicyResourceState. */ + public static final PolicyResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a PolicyResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyResourceState. + */ + @JsonCreator + public static PolicyResourceState fromString(String name) { + return fromString(name, PolicyResourceState.class); + } + + /** @return known PolicyResourceState values. */ + public static Collection values() { + return values(PolicyResourceState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicySettings.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicySettings.java new file mode 100644 index 0000000000000..45fbaae46c150 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PolicySettings.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines top-level WebApplicationFirewallPolicy configuration settings. */ +@Fluent +public final class PolicySettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicySettings.class); + + /* + * Describes if the policy is in enabled or disabled state. Defaults to + * Enabled if not specified. + */ + @JsonProperty(value = "enabledState") + private PolicyEnabledState enabledState; + + /* + * Describes if it is in detection mode or prevention mode at policy level. + */ + @JsonProperty(value = "mode") + private PolicyMode mode; + + /* + * If action type is redirect, this field represents redirect URL for the + * client. + */ + @JsonProperty(value = "redirectUrl") + private String redirectUrl; + + /* + * If the action type is block, customer can override the response status + * code. + */ + @JsonProperty(value = "customBlockResponseStatusCode") + private Integer customBlockResponseStatusCode; + + /* + * If the action type is block, customer can override the response body. + * The body must be specified in base64 encoding. + */ + @JsonProperty(value = "customBlockResponseBody") + private String customBlockResponseBody; + + /* + * Describes if policy managed rules will inspect the request body content. + */ + @JsonProperty(value = "requestBodyCheck") + private PolicyRequestBodyCheck requestBodyCheck; + + /** + * Get the enabledState property: Describes if the policy is in enabled or disabled state. Defaults to Enabled if + * not specified. + * + * @return the enabledState value. + */ + public PolicyEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Describes if the policy is in enabled or disabled state. Defaults to Enabled if + * not specified. + * + * @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 redirectUrl property: If action type is redirect, this field represents redirect URL for the client. + * + * @return the redirectUrl value. + */ + public String redirectUrl() { + return this.redirectUrl; + } + + /** + * Set the redirectUrl property: If action type is redirect, this field represents redirect URL for the client. + * + * @param redirectUrl the redirectUrl value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withRedirectUrl(String redirectUrl) { + this.redirectUrl = redirectUrl; + return this; + } + + /** + * Get the customBlockResponseStatusCode property: If the action type is block, customer can override the response + * status code. + * + * @return the customBlockResponseStatusCode value. + */ + public Integer customBlockResponseStatusCode() { + return this.customBlockResponseStatusCode; + } + + /** + * Set the customBlockResponseStatusCode property: If the action type is block, customer can override the response + * status code. + * + * @param customBlockResponseStatusCode the customBlockResponseStatusCode value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withCustomBlockResponseStatusCode(Integer customBlockResponseStatusCode) { + this.customBlockResponseStatusCode = customBlockResponseStatusCode; + return this; + } + + /** + * Get the customBlockResponseBody property: If the action type is block, customer can override the response body. + * The body must be specified in base64 encoding. + * + * @return the customBlockResponseBody value. + */ + public String customBlockResponseBody() { + return this.customBlockResponseBody; + } + + /** + * Set the customBlockResponseBody property: If the action type is block, customer can override the response body. + * The body must be specified in base64 encoding. + * + * @param customBlockResponseBody the customBlockResponseBody value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withCustomBlockResponseBody(String customBlockResponseBody) { + this.customBlockResponseBody = customBlockResponseBody; + return this; + } + + /** + * Get the requestBodyCheck property: Describes if policy managed rules will inspect the request body content. + * + * @return the requestBodyCheck value. + */ + public PolicyRequestBodyCheck requestBodyCheck() { + return this.requestBodyCheck; + } + + /** + * Set the requestBodyCheck property: Describes if policy managed rules will inspect the request body content. + * + * @param requestBodyCheck the requestBodyCheck value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withRequestBodyCheck(PolicyRequestBodyCheck requestBodyCheck) { + this.requestBodyCheck = requestBodyCheck; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpoint.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpoint.java new file mode 100644 index 0000000000000..699299248b089 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpoint.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.frontdoor.models; + +import com.azure.resourcemanager.frontdoor.fluent.models.PreconfiguredEndpointInner; +import java.util.Map; + +/** An immutable client-side representation of PreconfiguredEndpoint. */ +public interface PreconfiguredEndpoint { + /** + * 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 description property: The description of the endpoint. + * + * @return the description value. + */ + String description(); + + /** + * Gets the endpoint property: The endpoint that is preconfigured. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Gets the endpointType property: The type of endpoint. + * + * @return the endpointType value. + */ + EndpointType endpointType(); + + /** + * Gets the backend property: The preconfigured endpoint backend. + * + * @return the backend value. + */ + String backend(); + + /** + * Gets the inner com.azure.resourcemanager.frontdoor.fluent.models.PreconfiguredEndpointInner object. + * + * @return the inner object. + */ + PreconfiguredEndpointInner innerModel(); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpointList.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpointList.java new file mode 100644 index 0000000000000..9ec7a9ad59409 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpointList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.PreconfiguredEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a list of preconfigured endpoints. */ +@Fluent +public final class PreconfiguredEndpointList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PreconfiguredEndpointList.class); + + /* + * List of PreconfiguredEndpoints supported by NetworkExperiment. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of PreconfiguredEndpoints if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of PreconfiguredEndpoints supported by NetworkExperiment. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of PreconfiguredEndpoints 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 PreconfiguredEndpoints if there are any. + * + * @param nextLink the nextLink value to set. + * @return the PreconfiguredEndpointList object itself. + */ + public PreconfiguredEndpointList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpoints.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpoints.java new file mode 100644 index 0000000000000..bcbba4b36ae6b --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PreconfiguredEndpoints.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.frontdoor.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of PreconfiguredEndpoints. */ +public interface PreconfiguredEndpoints { + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of Preconfigured Endpoints. + */ + PagedIterable list(String resourceGroupName, String profileName); + + /** + * Gets a list of Preconfigured Endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of Preconfigured Endpoints. + */ + PagedIterable list(String resourceGroupName, String profileName, Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PrivateEndpointStatus.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PrivateEndpointStatus.java new file mode 100644 index 0000000000000..978167cc4cccc --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PrivateEndpointStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointStatus. */ +public final class PrivateEndpointStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Timeout for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a PrivateEndpointStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointStatus. + */ + @JsonCreator + public static PrivateEndpointStatus fromString(String name) { + return fromString(name, PrivateEndpointStatus.class); + } + + /** @return known PrivateEndpointStatus values. */ + public static Collection values() { + return values(PrivateEndpointStatus.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Profile.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Profile.java new file mode 100644 index 0000000000000..b5d070585ca4a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Profile.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.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 etag property: Gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the resourceState property: Resource status. + * + * @return the resourceState value. + */ + NetworkExperimentResourceState resourceState(); + + /** + * Gets the enabledState property: The state of the Experiment. + * + * @return the enabledState value. + */ + State 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 inner com.azure.resourcemanager.frontdoor.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.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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * 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.WithEtag, DefinitionStages.WithEnabledState { + /** + * 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 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 Profile definition allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: The state of the Experiment. + * + * @param enabledState The state of the Experiment. + * @return the next definition stage. + */ + WithCreate withEnabledState(State enabledState); + } + } + /** + * 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.WithEnabledState { + /** + * 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: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Profile update allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: The enabled state of the Profile. + * + * @param enabledState The enabled state of the Profile. + * @return the next definition stage. + */ + Update withEnabledState(State enabledState); + } + } + /** + * 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); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ProfileList.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ProfileList.java new file mode 100644 index 0000000000000..efa4086c12bcb --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ProfileList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.ProfileInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a list of Profiles. It contains a list of Profile objects and a URL link to get the next set of results. */ +@Fluent +public final class ProfileList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProfileList.class); + + /* + * List of Profiles within a resource group. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of Profile objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of 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 ProfileList object itself. + */ + public ProfileList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ProfileUpdateModel.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ProfileUpdateModel.java new file mode 100644 index 0000000000000..1e378b31d7f46 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ProfileUpdateModel.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines modifiable attributes of a Profile. */ +@JsonFlatten +@Fluent +public class ProfileUpdateModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProfileUpdateModel.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The enabled state of the Profile + */ + @JsonProperty(value = "properties.enabledState") + private State enabledState; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ProfileUpdateModel object itself. + */ + public ProfileUpdateModel withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the enabledState property: The enabled state of the Profile. + * + * @return the enabledState value. + */ + public State enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: The enabled state of the Profile. + * + * @param enabledState the enabledState value to set. + * @return the ProfileUpdateModel object itself. + */ + public ProfileUpdateModel withEnabledState(State enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PurgeParameters.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PurgeParameters.java new file mode 100644 index 0000000000000..d4eed4f9ca010 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/PurgeParameters.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters required for content purge. */ +@Fluent +public final class PurgeParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PurgeParameters.class); + + /* + * The path to the content to be purged. Can describe a file path or a wild + * card directory. + */ + @JsonProperty(value = "contentPaths", required = true) + private List contentPaths; + + /** + * Get the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @return the contentPaths value. + */ + public List contentPaths() { + return this.contentPaths; + } + + /** + * Set the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @param contentPaths the contentPaths value to set. + * @return the PurgeParameters object itself. + */ + public PurgeParameters withContentPaths(List contentPaths) { + this.contentPaths = contentPaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentPaths() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property contentPaths in model PurgeParameters")); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RedirectConfiguration.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RedirectConfiguration.java new file mode 100644 index 0000000000000..60805518e9145 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RedirectConfiguration.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes Redirect Route. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration") +@JsonFlatten +@Fluent +public class RedirectConfiguration extends RouteConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RedirectConfiguration.class); + + /* + * The redirect type the rule will use when redirecting traffic. + */ + @JsonProperty(value = "redirectType") + private FrontDoorRedirectType redirectType; + + /* + * The protocol of the destination to where the traffic is redirected + */ + @JsonProperty(value = "redirectProtocol") + private FrontDoorRedirectProtocol redirectProtocol; + + /* + * Host to redirect. Leave empty to use the incoming host as the + * destination host. + */ + @JsonProperty(value = "customHost") + private String customHost; + + /* + * The full path to redirect. Path cannot be empty and must start with /. + * Leave empty to use the incoming path as destination path. + */ + @JsonProperty(value = "customPath") + private String customPath; + + /* + * Fragment to add to the redirect URL. Fragment is the part of the URL + * that comes after #. Do not include the #. + */ + @JsonProperty(value = "customFragment") + private String customFragment; + + /* + * 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. + * The first ? and & will be added automatically so do not include them in + * the front, but do separate multiple query strings with &. + */ + @JsonProperty(value = "customQueryString") + private String customQueryString; + + /** + * Get the redirectType property: The redirect type the rule will use when redirecting traffic. + * + * @return the redirectType value. + */ + public FrontDoorRedirectType 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 RedirectConfiguration object itself. + */ + public RedirectConfiguration withRedirectType(FrontDoorRedirectType redirectType) { + this.redirectType = redirectType; + return this; + } + + /** + * Get the redirectProtocol property: The protocol of the destination to where the traffic is redirected. + * + * @return the redirectProtocol value. + */ + public FrontDoorRedirectProtocol redirectProtocol() { + return this.redirectProtocol; + } + + /** + * Set the redirectProtocol property: The protocol of the destination to where the traffic is redirected. + * + * @param redirectProtocol the redirectProtocol value to set. + * @return the RedirectConfiguration object itself. + */ + public RedirectConfiguration withRedirectProtocol(FrontDoorRedirectProtocol redirectProtocol) { + this.redirectProtocol = redirectProtocol; + return this; + } + + /** + * Get the customHost property: Host to redirect. Leave empty to use the incoming host as the destination host. + * + * @return the customHost value. + */ + public String customHost() { + return this.customHost; + } + + /** + * Set the customHost property: Host to redirect. Leave empty to use the incoming host as the destination host. + * + * @param customHost the customHost value to set. + * @return the RedirectConfiguration object itself. + */ + public RedirectConfiguration withCustomHost(String customHost) { + this.customHost = customHost; + 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 RedirectConfiguration object itself. + */ + public RedirectConfiguration withCustomPath(String customPath) { + this.customPath = customPath; + 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 RedirectConfiguration object itself. + */ + public RedirectConfiguration withCustomFragment(String customFragment) { + this.customFragment = customFragment; + 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. The first ? and & will be added automatically so do not include them in + * the front, but do separate multiple query strings with &. + * + * @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. The first ? and & will be added automatically so do not include them in + * the front, but do separate multiple query strings with &. + * + * @param customQueryString the customQueryString value to set. + * @return the RedirectConfiguration object itself. + */ + public RedirectConfiguration withCustomQueryString(String customQueryString) { + this.customQueryString = customQueryString; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Reports.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Reports.java new file mode 100644 index 0000000000000..218cb4da72c5b --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Reports.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.frontdoor.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.time.OffsetDateTime; + +/** Resource collection API of Reports. */ +public interface Reports { + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Latency Scorecard for a given Experiment. + */ + LatencyScorecard getLatencyScorecards( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval); + + /** + * Gets a Latency Scorecard for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param aggregationInterval The aggregation interval of the Latency Scorecard. + * @param endDateTimeUtc The end DateTime of the Latency Scorecard in UTC. + * @param country The country associated with the Latency Scorecard. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Latency Scorecard for a given Experiment. + */ + Response getLatencyScorecardsWithResponse( + String resourceGroupName, + String profileName, + String experimentName, + LatencyScorecardAggregationInterval aggregationInterval, + String endDateTimeUtc, + String country, + Context context); + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Timeseries for a given Experiment. + */ + Timeseries getTimeseries( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType); + + /** + * Gets a Timeseries for a given Experiment. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName The Profile identifier associated with the Tenant and Partner. + * @param experimentName The Experiment identifier associated with the Experiment. + * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. + * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. + * @param aggregationInterval The aggregation interval of the Timeseries. + * @param timeseriesType The type of Timeseries. + * @param endpoint The specific endpoint. + * @param country The country associated with the Timeseries. Values are country ISO codes as specified here- + * https://www.iso.org/iso-3166-country-codes.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Timeseries for a given Experiment. + */ + Response getTimeseriesWithResponse( + String resourceGroupName, + String profileName, + String experimentName, + OffsetDateTime startDateTimeUtc, + OffsetDateTime endDateTimeUtc, + TimeseriesAggregationInterval aggregationInterval, + TimeseriesType timeseriesType, + String endpoint, + String country, + Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ResourceType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ResourceType.java new file mode 100644 index 0000000000000..50fd7b92e0d64 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ResourceType.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.frontdoor.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceType. */ +public enum ResourceType { + /** Enum value Microsoft.Network/frontDoors. */ + MICROSOFT_NETWORK_FRONT_DOORS("Microsoft.Network/frontDoors"), + + /** Enum value Microsoft.Network/frontDoors/frontendEndpoints. */ + MICROSOFT_NETWORK_FRONT_DOORS_FRONTEND_ENDPOINTS("Microsoft.Network/frontDoors/frontendEndpoints"); + + /** The actual serialized value for a ResourceType instance. */ + private final String value; + + ResourceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceType fromString(String value) { + ResourceType[] items = ResourceType.values(); + for (ResourceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RouteConfiguration.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RouteConfiguration.java new file mode 100644 index 0000000000000..5511286093130 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RouteConfiguration.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.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for all types of Route. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = RouteConfiguration.class) +@JsonTypeName("RouteConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration", + value = ForwardingConfiguration.class), + @JsonSubTypes.Type( + name = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration", + value = RedirectConfiguration.class) +}) +@JsonFlatten +@Immutable +public class RouteConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteConfiguration.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRule.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRule.java new file mode 100644 index 0000000000000..15f251ab5676f --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRule.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A routing rule represents a specification for traffic to treat and where to send it, along with health probe + * information. + */ +@JsonFlatten +@Fluent +public class RoutingRule extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingRule.class); + + /* + * Resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Frontend endpoints associated with this rule + */ + @JsonProperty(value = "properties.frontendEndpoints") + private List frontendEndpoints; + + /* + * Protocol schemes to match for this rule + */ + @JsonProperty(value = "properties.acceptedProtocols") + private List acceptedProtocols; + + /* + * The route patterns of the rule. + */ + @JsonProperty(value = "properties.patternsToMatch") + private List patternsToMatch; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or + * 'Disabled' + */ + @JsonProperty(value = "properties.enabledState") + private RoutingRuleEnabledState enabledState; + + /* + * A reference to the routing configuration. + */ + @JsonProperty(value = "properties.routeConfiguration") + private RouteConfiguration routeConfiguration; + + /* + * A reference to a specific Rules Engine Configuration to apply to this + * route. + */ + @JsonProperty(value = "properties.rulesEngine") + private SubResource rulesEngine; + + /* + * Defines the Web Application Firewall policy for each routing rule (if + * applicable) + */ + @JsonProperty(value = "properties.webApplicationFirewallPolicyLink") + private RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink; + + /* + * Resource status. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the RoutingRule object itself. + */ + public RoutingRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the frontendEndpoints property: Frontend endpoints associated with this rule. + * + * @return the frontendEndpoints value. + */ + public List frontendEndpoints() { + return this.frontendEndpoints; + } + + /** + * Set the frontendEndpoints property: Frontend endpoints associated with this rule. + * + * @param frontendEndpoints the frontendEndpoints value to set. + * @return the RoutingRule object itself. + */ + public RoutingRule withFrontendEndpoints(List frontendEndpoints) { + this.frontendEndpoints = frontendEndpoints; + return this; + } + + /** + * Get the acceptedProtocols property: Protocol schemes to match for this rule. + * + * @return the acceptedProtocols value. + */ + public List acceptedProtocols() { + return this.acceptedProtocols; + } + + /** + * Set the acceptedProtocols property: Protocol schemes to match for this rule. + * + * @param acceptedProtocols the acceptedProtocols value to set. + * @return the RoutingRule object itself. + */ + public RoutingRule withAcceptedProtocols(List acceptedProtocols) { + this.acceptedProtocols = acceptedProtocols; + 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 RoutingRule object itself. + */ + public RoutingRule withPatternsToMatch(List patternsToMatch) { + this.patternsToMatch = patternsToMatch; + return this; + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public RoutingRuleEnabledState 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 RoutingRule object itself. + */ + public RoutingRule withEnabledState(RoutingRuleEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the routeConfiguration property: A reference to the routing configuration. + * + * @return the routeConfiguration value. + */ + public RouteConfiguration routeConfiguration() { + return this.routeConfiguration; + } + + /** + * Set the routeConfiguration property: A reference to the routing configuration. + * + * @param routeConfiguration the routeConfiguration value to set. + * @return the RoutingRule object itself. + */ + public RoutingRule withRouteConfiguration(RouteConfiguration routeConfiguration) { + this.routeConfiguration = routeConfiguration; + return this; + } + + /** + * Get the rulesEngine property: A reference to a specific Rules Engine Configuration to apply to this route. + * + * @return the rulesEngine value. + */ + public SubResource rulesEngine() { + return this.rulesEngine; + } + + /** + * Set the rulesEngine property: A reference to a specific Rules Engine Configuration to apply to this route. + * + * @param rulesEngine the rulesEngine value to set. + * @return the RoutingRule object itself. + */ + public RoutingRule withRulesEngine(SubResource rulesEngine) { + this.rulesEngine = rulesEngine; + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for each routing + * rule (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.webApplicationFirewallPolicyLink; + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for each routing + * rule (if applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the RoutingRule object itself. + */ + public RoutingRule withWebApplicationFirewallPolicyLink( + RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + this.webApplicationFirewallPolicyLink = webApplicationFirewallPolicyLink; + return this; + } + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public RoutingRule withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routeConfiguration() != null) { + routeConfiguration().validate(); + } + if (webApplicationFirewallPolicyLink() != null) { + webApplicationFirewallPolicyLink().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleEnabledState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleEnabledState.java new file mode 100644 index 0000000000000..e45eb68dae45b --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleEnabledState.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RoutingRuleEnabledState. */ +public final class RoutingRuleEnabledState extends ExpandableStringEnum { + /** Static value Enabled for RoutingRuleEnabledState. */ + public static final RoutingRuleEnabledState ENABLED = fromString("Enabled"); + + /** Static value Disabled for RoutingRuleEnabledState. */ + public static final RoutingRuleEnabledState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a RoutingRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingRuleEnabledState. + */ + @JsonCreator + public static RoutingRuleEnabledState fromString(String name) { + return fromString(name, RoutingRuleEnabledState.class); + } + + /** @return known RoutingRuleEnabledState values. */ + public static Collection values() { + return values(RoutingRuleEnabledState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleLink.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleLink.java new file mode 100644 index 0000000000000..95fadf0ff1bd8 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleLink.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the Resource ID for a Routing Rule. */ +@Fluent +public final class RoutingRuleLink { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingRuleLink.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the RoutingRuleLink object itself. + */ + public RoutingRuleLink withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleProperties.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleProperties.java new file mode 100644 index 0000000000000..251bbad7a0d05 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleProperties.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.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties required to create a routing rule. */ +@Immutable +public final class RoutingRuleProperties extends RoutingRuleUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingRuleProperties.class); + + /* + * Resource status. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public RoutingRuleProperties withFrontendEndpoints(List frontendEndpoints) { + super.withFrontendEndpoints(frontendEndpoints); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoutingRuleProperties withAcceptedProtocols(List acceptedProtocols) { + super.withAcceptedProtocols(acceptedProtocols); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoutingRuleProperties withPatternsToMatch(List patternsToMatch) { + super.withPatternsToMatch(patternsToMatch); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoutingRuleProperties withEnabledState(RoutingRuleEnabledState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoutingRuleProperties withRouteConfiguration(RouteConfiguration routeConfiguration) { + super.withRouteConfiguration(routeConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoutingRuleProperties withRulesEngine(SubResource rulesEngine) { + super.withRulesEngine(rulesEngine); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoutingRuleProperties withWebApplicationFirewallPolicyLink( + RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + super.withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleUpdateParameters.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleUpdateParameters.java new file mode 100644 index 0000000000000..1d84c20235ab5 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleUpdateParameters.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Routing rules to apply to an endpoint. */ +@Fluent +public class RoutingRuleUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingRuleUpdateParameters.class); + + /* + * Frontend endpoints associated with this rule + */ + @JsonProperty(value = "frontendEndpoints") + private List frontendEndpoints; + + /* + * Protocol schemes to match for this rule + */ + @JsonProperty(value = "acceptedProtocols") + private List acceptedProtocols; + + /* + * The route patterns of the rule. + */ + @JsonProperty(value = "patternsToMatch") + private List patternsToMatch; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or + * 'Disabled' + */ + @JsonProperty(value = "enabledState") + private RoutingRuleEnabledState enabledState; + + /* + * A reference to the routing configuration. + */ + @JsonProperty(value = "routeConfiguration") + private RouteConfiguration routeConfiguration; + + /* + * A reference to a specific Rules Engine Configuration to apply to this + * route. + */ + @JsonProperty(value = "rulesEngine") + private SubResource rulesEngine; + + /* + * Defines the Web Application Firewall policy for each routing rule (if + * applicable) + */ + @JsonProperty(value = "webApplicationFirewallPolicyLink") + private RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink; + + /** + * Get the frontendEndpoints property: Frontend endpoints associated with this rule. + * + * @return the frontendEndpoints value. + */ + public List frontendEndpoints() { + return this.frontendEndpoints; + } + + /** + * Set the frontendEndpoints property: Frontend endpoints associated with this rule. + * + * @param frontendEndpoints the frontendEndpoints value to set. + * @return the RoutingRuleUpdateParameters object itself. + */ + public RoutingRuleUpdateParameters withFrontendEndpoints(List frontendEndpoints) { + this.frontendEndpoints = frontendEndpoints; + return this; + } + + /** + * Get the acceptedProtocols property: Protocol schemes to match for this rule. + * + * @return the acceptedProtocols value. + */ + public List acceptedProtocols() { + return this.acceptedProtocols; + } + + /** + * Set the acceptedProtocols property: Protocol schemes to match for this rule. + * + * @param acceptedProtocols the acceptedProtocols value to set. + * @return the RoutingRuleUpdateParameters object itself. + */ + public RoutingRuleUpdateParameters withAcceptedProtocols(List acceptedProtocols) { + this.acceptedProtocols = acceptedProtocols; + 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 RoutingRuleUpdateParameters object itself. + */ + public RoutingRuleUpdateParameters withPatternsToMatch(List patternsToMatch) { + this.patternsToMatch = patternsToMatch; + return this; + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public RoutingRuleEnabledState 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 RoutingRuleUpdateParameters object itself. + */ + public RoutingRuleUpdateParameters withEnabledState(RoutingRuleEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the routeConfiguration property: A reference to the routing configuration. + * + * @return the routeConfiguration value. + */ + public RouteConfiguration routeConfiguration() { + return this.routeConfiguration; + } + + /** + * Set the routeConfiguration property: A reference to the routing configuration. + * + * @param routeConfiguration the routeConfiguration value to set. + * @return the RoutingRuleUpdateParameters object itself. + */ + public RoutingRuleUpdateParameters withRouteConfiguration(RouteConfiguration routeConfiguration) { + this.routeConfiguration = routeConfiguration; + return this; + } + + /** + * Get the rulesEngine property: A reference to a specific Rules Engine Configuration to apply to this route. + * + * @return the rulesEngine value. + */ + public SubResource rulesEngine() { + return this.rulesEngine; + } + + /** + * Set the rulesEngine property: A reference to a specific Rules Engine Configuration to apply to this route. + * + * @param rulesEngine the rulesEngine value to set. + * @return the RoutingRuleUpdateParameters object itself. + */ + public RoutingRuleUpdateParameters withRulesEngine(SubResource rulesEngine) { + this.rulesEngine = rulesEngine; + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for each routing + * rule (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.webApplicationFirewallPolicyLink; + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for each routing + * rule (if applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the RoutingRuleUpdateParameters object itself. + */ + public RoutingRuleUpdateParameters withWebApplicationFirewallPolicyLink( + RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + this.webApplicationFirewallPolicyLink = webApplicationFirewallPolicyLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routeConfiguration() != null) { + routeConfiguration().validate(); + } + if (webApplicationFirewallPolicyLink() != null) { + webApplicationFirewallPolicyLink().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink.java new file mode 100644 index 0000000000000..c671690c2565a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the Web Application Firewall policy for each routing rule (if applicable). */ +@Fluent +public final class RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink object itself. + */ + public RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RuleType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RuleType.java new file mode 100644 index 0000000000000..110ba42d57792 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RuleType.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RuleType. */ +public final class RuleType extends ExpandableStringEnum { + /** Static value MatchRule for RuleType. */ + public static final RuleType MATCH_RULE = fromString("MatchRule"); + + /** Static value RateLimitRule for RuleType. */ + public static final RuleType RATE_LIMIT_RULE = fromString("RateLimitRule"); + + /** + * Creates or finds a RuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleType. + */ + @JsonCreator + public static RuleType fromString(String name) { + return fromString(name, RuleType.class); + } + + /** @return known RuleType values. */ + public static Collection values() { + return values(RuleType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngine.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngine.java new file mode 100644 index 0000000000000..dacb03ad1c21a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngine.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.frontdoor.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner; +import java.util.List; + +/** An immutable client-side representation of RulesEngine. */ +public interface RulesEngine { + /** + * 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 rules property: A list of rules that define a particular Rules Engine Configuration. + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the resourceState property: Resource status. + * + * @return the resourceState value. + */ + FrontDoorResourceState resourceState(); + + /** + * Gets the inner com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner object. + * + * @return the inner object. + */ + RulesEngineInner innerModel(); + + /** The entirety of the RulesEngine definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The RulesEngine definition stages. */ + interface DefinitionStages { + /** The first stage of the RulesEngine definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the RulesEngine definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, frontDoorName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @return the next definition stage. + */ + WithCreate withExistingFrontDoor(String resourceGroupName, String frontDoorName); + } + /** + * The stage of the RulesEngine 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.WithRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + RulesEngine create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RulesEngine create(Context context); + } + /** The stage of the RulesEngine definition allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: A list of rules that define a particular Rules Engine Configuration.. + * + * @param rules A list of rules that define a particular Rules Engine Configuration. + * @return the next definition stage. + */ + WithCreate withRules(List rules); + } + } + /** + * Begins update for the RulesEngine resource. + * + * @return the stage of resource update. + */ + RulesEngine.Update update(); + + /** The template for RulesEngine update. */ + interface Update extends UpdateStages.WithRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RulesEngine apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RulesEngine apply(Context context); + } + /** The RulesEngine update stages. */ + interface UpdateStages { + /** The stage of the RulesEngine update allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: A list of rules that define a particular Rules Engine Configuration.. + * + * @param rules A list of rules that define a particular Rules Engine Configuration. + * @return the next definition stage. + */ + Update withRules(List rules); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RulesEngine refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RulesEngine refresh(Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineAction.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineAction.java new file mode 100644 index 0000000000000..e7647cd87f946 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineAction.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** One or more actions that will execute, modifying the request and/or response. */ +@Fluent +public final class RulesEngineAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesEngineAction.class); + + /* + * A list of header actions to apply from the request from AFD to the + * origin. + */ + @JsonProperty(value = "requestHeaderActions") + private List requestHeaderActions; + + /* + * A list of header actions to apply from the response from AFD to the + * client. + */ + @JsonProperty(value = "responseHeaderActions") + private List responseHeaderActions; + + /* + * Override the route configuration. + */ + @JsonProperty(value = "routeConfigurationOverride") + private RouteConfiguration routeConfigurationOverride; + + /** + * Get the requestHeaderActions property: A list of header actions to apply from the request from AFD to the origin. + * + * @return the requestHeaderActions value. + */ + public List requestHeaderActions() { + return this.requestHeaderActions; + } + + /** + * Set the requestHeaderActions property: A list of header actions to apply from the request from AFD to the origin. + * + * @param requestHeaderActions the requestHeaderActions value to set. + * @return the RulesEngineAction object itself. + */ + public RulesEngineAction withRequestHeaderActions(List requestHeaderActions) { + this.requestHeaderActions = requestHeaderActions; + return this; + } + + /** + * Get the responseHeaderActions property: A list of header actions to apply from the response from AFD to the + * client. + * + * @return the responseHeaderActions value. + */ + public List responseHeaderActions() { + return this.responseHeaderActions; + } + + /** + * Set the responseHeaderActions property: A list of header actions to apply from the response from AFD to the + * client. + * + * @param responseHeaderActions the responseHeaderActions value to set. + * @return the RulesEngineAction object itself. + */ + public RulesEngineAction withResponseHeaderActions(List responseHeaderActions) { + this.responseHeaderActions = responseHeaderActions; + return this; + } + + /** + * Get the routeConfigurationOverride property: Override the route configuration. + * + * @return the routeConfigurationOverride value. + */ + public RouteConfiguration routeConfigurationOverride() { + return this.routeConfigurationOverride; + } + + /** + * Set the routeConfigurationOverride property: Override the route configuration. + * + * @param routeConfigurationOverride the routeConfigurationOverride value to set. + * @return the RulesEngineAction object itself. + */ + public RulesEngineAction withRouteConfigurationOverride(RouteConfiguration routeConfigurationOverride) { + this.routeConfigurationOverride = routeConfigurationOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requestHeaderActions() != null) { + requestHeaderActions().forEach(e -> e.validate()); + } + if (responseHeaderActions() != null) { + responseHeaderActions().forEach(e -> e.validate()); + } + if (routeConfigurationOverride() != null) { + routeConfigurationOverride().validate(); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineListResult.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineListResult.java new file mode 100644 index 0000000000000..74cf440abbcf6 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Rules Engine Configurations. It contains a list of RulesEngine objects and a URL link + * to get the next set of results. + */ +@Fluent +public final class RulesEngineListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesEngineListResult.class); + + /* + * List of rulesEngines within a Front Door. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of RulesEngine objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of rulesEngines within a Front Door. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of RulesEngine 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 RulesEngine objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the RulesEngineListResult object itself. + */ + public RulesEngineListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineMatchCondition.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineMatchCondition.java new file mode 100644 index 0000000000000..4a3a6a305ce11 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineMatchCondition.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Define a match condition. */ +@Fluent +public final class RulesEngineMatchCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesEngineMatchCondition.class); + + /* + * Match Variable + */ + @JsonProperty(value = "rulesEngineMatchVariable", required = true) + private RulesEngineMatchVariable rulesEngineMatchVariable; + + /* + * Name of selector in RequestHeader or RequestBody to be matched + */ + @JsonProperty(value = "selector") + private String selector; + + /* + * Describes operator to apply to the match condition. + */ + @JsonProperty(value = "rulesEngineOperator", required = true) + private RulesEngineOperator rulesEngineOperator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * Match values to match against. The operator will apply to each value in + * here with OR semantics. If any of them match the variable with the given + * operator this match condition is considered a match. + */ + @JsonProperty(value = "rulesEngineMatchValue", required = true) + private List rulesEngineMatchValue; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** + * Get the rulesEngineMatchVariable property: Match Variable. + * + * @return the rulesEngineMatchVariable value. + */ + public RulesEngineMatchVariable rulesEngineMatchVariable() { + return this.rulesEngineMatchVariable; + } + + /** + * Set the rulesEngineMatchVariable property: Match Variable. + * + * @param rulesEngineMatchVariable the rulesEngineMatchVariable value to set. + * @return the RulesEngineMatchCondition object itself. + */ + public RulesEngineMatchCondition withRulesEngineMatchVariable(RulesEngineMatchVariable rulesEngineMatchVariable) { + this.rulesEngineMatchVariable = rulesEngineMatchVariable; + return this; + } + + /** + * Get the selector property: Name of selector in RequestHeader or RequestBody to be matched. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: Name of selector in RequestHeader or RequestBody to be matched. + * + * @param selector the selector value to set. + * @return the RulesEngineMatchCondition object itself. + */ + public RulesEngineMatchCondition withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Get the rulesEngineOperator property: Describes operator to apply to the match condition. + * + * @return the rulesEngineOperator value. + */ + public RulesEngineOperator rulesEngineOperator() { + return this.rulesEngineOperator; + } + + /** + * Set the rulesEngineOperator property: Describes operator to apply to the match condition. + * + * @param rulesEngineOperator the rulesEngineOperator value to set. + * @return the RulesEngineMatchCondition object itself. + */ + public RulesEngineMatchCondition withRulesEngineOperator(RulesEngineOperator rulesEngineOperator) { + this.rulesEngineOperator = rulesEngineOperator; + 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 RulesEngineMatchCondition object itself. + */ + public RulesEngineMatchCondition withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the rulesEngineMatchValue 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 rulesEngineMatchValue value. + */ + public List rulesEngineMatchValue() { + return this.rulesEngineMatchValue; + } + + /** + * Set the rulesEngineMatchValue 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 rulesEngineMatchValue the rulesEngineMatchValue value to set. + * @return the RulesEngineMatchCondition object itself. + */ + public RulesEngineMatchCondition withRulesEngineMatchValue(List rulesEngineMatchValue) { + this.rulesEngineMatchValue = rulesEngineMatchValue; + 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 RulesEngineMatchCondition object itself. + */ + public RulesEngineMatchCondition withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rulesEngineMatchVariable() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rulesEngineMatchVariable in model RulesEngineMatchCondition")); + } + if (rulesEngineOperator() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rulesEngineOperator in model RulesEngineMatchCondition")); + } + if (rulesEngineMatchValue() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rulesEngineMatchValue in model RulesEngineMatchCondition")); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineMatchVariable.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineMatchVariable.java new file mode 100644 index 0000000000000..81fadc6545664 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineMatchVariable.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RulesEngineMatchVariable. */ +public final class RulesEngineMatchVariable extends ExpandableStringEnum { + /** Static value IsMobile for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable IS_MOBILE = fromString("IsMobile"); + + /** Static value RemoteAddr for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable REMOTE_ADDR = fromString("RemoteAddr"); + + /** Static value RequestMethod for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable REQUEST_METHOD = fromString("RequestMethod"); + + /** Static value QueryString for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable QUERY_STRING = fromString("QueryString"); + + /** Static value PostArgs for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable POST_ARGS = fromString("PostArgs"); + + /** Static value RequestUri for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable REQUEST_URI = fromString("RequestUri"); + + /** Static value RequestPath for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable REQUEST_PATH = fromString("RequestPath"); + + /** Static value RequestFilename for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable REQUEST_FILENAME = fromString("RequestFilename"); + + /** Static value RequestFilenameExtension for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable REQUEST_FILENAME_EXTENSION = fromString("RequestFilenameExtension"); + + /** Static value RequestHeader for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable REQUEST_HEADER = fromString("RequestHeader"); + + /** Static value RequestBody for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable REQUEST_BODY = fromString("RequestBody"); + + /** Static value RequestScheme for RulesEngineMatchVariable. */ + public static final RulesEngineMatchVariable REQUEST_SCHEME = fromString("RequestScheme"); + + /** + * Creates or finds a RulesEngineMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding RulesEngineMatchVariable. + */ + @JsonCreator + public static RulesEngineMatchVariable fromString(String name) { + return fromString(name, RulesEngineMatchVariable.class); + } + + /** @return known RulesEngineMatchVariable values. */ + public static Collection values() { + return values(RulesEngineMatchVariable.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineOperator.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineOperator.java new file mode 100644 index 0000000000000..f7879a2a48261 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineOperator.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RulesEngineOperator. */ +public final class RulesEngineOperator extends ExpandableStringEnum { + /** Static value Any for RulesEngineOperator. */ + public static final RulesEngineOperator ANY = fromString("Any"); + + /** Static value IPMatch for RulesEngineOperator. */ + public static final RulesEngineOperator IPMATCH = fromString("IPMatch"); + + /** Static value GeoMatch for RulesEngineOperator. */ + public static final RulesEngineOperator GEO_MATCH = fromString("GeoMatch"); + + /** Static value Equal for RulesEngineOperator. */ + public static final RulesEngineOperator EQUAL = fromString("Equal"); + + /** Static value Contains for RulesEngineOperator. */ + public static final RulesEngineOperator CONTAINS = fromString("Contains"); + + /** Static value LessThan for RulesEngineOperator. */ + public static final RulesEngineOperator LESS_THAN = fromString("LessThan"); + + /** Static value GreaterThan for RulesEngineOperator. */ + public static final RulesEngineOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value LessThanOrEqual for RulesEngineOperator. */ + public static final RulesEngineOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThanOrEqual for RulesEngineOperator. */ + public static final RulesEngineOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value BeginsWith for RulesEngineOperator. */ + public static final RulesEngineOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for RulesEngineOperator. */ + public static final RulesEngineOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Creates or finds a RulesEngineOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RulesEngineOperator. + */ + @JsonCreator + public static RulesEngineOperator fromString(String name) { + return fromString(name, RulesEngineOperator.class); + } + + /** @return known RulesEngineOperator values. */ + public static Collection values() { + return values(RulesEngineOperator.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineProperties.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineProperties.java new file mode 100644 index 0000000000000..06adf55718ddb --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineProperties.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.frontdoor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties required to create a Rules Engine Configuration. */ +@Immutable +public final class RulesEngineProperties extends RulesEngineUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesEngineProperties.class); + + /* + * Resource status. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private FrontDoorResourceState resourceState; + + /** + * Get the resourceState property: Resource status. + * + * @return the resourceState value. + */ + public FrontDoorResourceState resourceState() { + return this.resourceState; + } + + /** {@inheritDoc} */ + @Override + public RulesEngineProperties withRules(List rules) { + super.withRules(rules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineRule.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineRule.java new file mode 100644 index 0000000000000..e3bcb269ef43d --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineRule.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Contains a list of match conditions, and an action on how to modify the request/response. If multiple rules match, + * the actions from one rule that conflict with a previous rule overwrite for a singular action, or append in the case + * of headers manipulation. + */ +@Fluent +public final class RulesEngineRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesEngineRule.class); + + /* + * A name to refer to this specific rule. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * A priority assigned to this rule. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /* + * Actions to perform on the request and response if all of the match + * conditions are met. + */ + @JsonProperty(value = "action", required = true) + private RulesEngineAction action; + + /* + * A list of match conditions that must meet in order for the actions of + * this rule to run. Having no match conditions means the actions will + * always run. + */ + @JsonProperty(value = "matchConditions") + private List matchConditions; + + /* + * If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + */ + @JsonProperty(value = "matchProcessingBehavior") + private MatchProcessingBehavior matchProcessingBehavior; + + /** + * Get the name property: A name to refer to this specific rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A name to refer to this specific rule. + * + * @param name the name value to set. + * @return the RulesEngineRule object itself. + */ + public RulesEngineRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the priority property: A priority assigned to this rule. + * + * @return the priority value. + */ + public int priority() { + return this.priority; + } + + /** + * Set the priority property: A priority assigned to this rule. + * + * @param priority the priority value to set. + * @return the RulesEngineRule object itself. + */ + public RulesEngineRule withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get the action property: Actions to perform on the request and response if all of the match conditions are met. + * + * @return the action value. + */ + public RulesEngineAction action() { + return this.action; + } + + /** + * Set the action property: Actions to perform on the request and response if all of the match conditions are met. + * + * @param action the action value to set. + * @return the RulesEngineRule object itself. + */ + public RulesEngineRule withAction(RulesEngineAction action) { + this.action = action; + return this; + } + + /** + * Get the matchConditions property: A list of match conditions that must meet in order for the actions of this rule + * to run. Having no match conditions means the actions will always run. + * + * @return the matchConditions value. + */ + public List matchConditions() { + return this.matchConditions; + } + + /** + * Set the matchConditions property: A list of match conditions that must meet in order for the actions of this rule + * to run. Having no match conditions means the actions will always run. + * + * @param matchConditions the matchConditions value to set. + * @return the RulesEngineRule object itself. + */ + public RulesEngineRule withMatchConditions(List matchConditions) { + this.matchConditions = matchConditions; + 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 RulesEngineRule object itself. + */ + public RulesEngineRule withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) { + this.matchProcessingBehavior = matchProcessingBehavior; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model RulesEngineRule")); + } + if (action() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model RulesEngineRule")); + } else { + action().validate(); + } + if (matchConditions() != null) { + matchConditions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineUpdateParameters.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineUpdateParameters.java new file mode 100644 index 0000000000000..ed07c93e286fe --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngineUpdateParameters.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rules Engine Configuration to apply to a Routing Rule. */ +@Fluent +public class RulesEngineUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesEngineUpdateParameters.class); + + /* + * A list of rules that define a particular Rules Engine Configuration. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the rules property: A list of rules that define a particular Rules Engine Configuration. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: A list of rules that define a particular Rules Engine Configuration. + * + * @param rules the rules value to set. + * @return the RulesEngineUpdateParameters object itself. + */ + public RulesEngineUpdateParameters withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngines.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngines.java new file mode 100644 index 0000000000000..92072ace01802 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/RulesEngines.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.frontdoor.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 RulesEngines. */ +public interface RulesEngines { + /** + * Lists all of the Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 Engine Configurations. + */ + PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName); + + /** + * Lists all of the Rules Engine Configurations within a Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 Engine Configurations. + */ + PagedIterable listByFrontDoor(String resourceGroupName, String frontDoorName, Context context); + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Rules Engine Configuration with the specified name within the specified Front Door. + */ + RulesEngine get(String resourceGroupName, String frontDoorName, String rulesEngineName); + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Rules Engine Configuration with the specified name within the specified Front Door. + */ + Response getWithResponse( + String resourceGroupName, String frontDoorName, String rulesEngineName, Context context); + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 frontDoorName, String rulesEngineName); + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param frontDoorName Name of the Front Door which is globally unique. + * @param rulesEngineName Name of the Rules Engine which is unique within the Front Door. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 frontDoorName, String rulesEngineName, Context context); + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Rules Engine Configuration with the specified name within the specified Front Door. + */ + RulesEngine getById(String id); + + /** + * Gets a Rules Engine Configuration with the specified name within the specified Front Door. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Rules Engine Configuration with the specified name within the specified Front Door. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing Rules Engine Configuration with the specified parameters. + * + * @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 Rules Engine Configuration with the specified parameters. + * + * @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 RulesEngine resource. + * + * @param name resource name. + * @return the first stage of the new RulesEngine definition. + */ + RulesEngine.DefinitionStages.Blank define(String name); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SecurityPolicyLink.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SecurityPolicyLink.java new file mode 100644 index 0000000000000..f7155d13e0c22 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SecurityPolicyLink.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the Resource ID for a Security Policy. */ +@Fluent +public final class SecurityPolicyLink { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPolicyLink.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the SecurityPolicyLink object itself. + */ + public SecurityPolicyLink withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SessionAffinityEnabledState.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SessionAffinityEnabledState.java new file mode 100644 index 0000000000000..7f4d77064b08a --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SessionAffinityEnabledState.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SessionAffinityEnabledState. */ +public final class SessionAffinityEnabledState extends ExpandableStringEnum { + /** Static value Enabled for SessionAffinityEnabledState. */ + public static final SessionAffinityEnabledState ENABLED = fromString("Enabled"); + + /** Static value Disabled for SessionAffinityEnabledState. */ + public static final SessionAffinityEnabledState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SessionAffinityEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionAffinityEnabledState. + */ + @JsonCreator + public static SessionAffinityEnabledState fromString(String name) { + return fromString(name, SessionAffinityEnabledState.class); + } + + /** @return known SessionAffinityEnabledState values. */ + public static Collection values() { + return values(SessionAffinityEnabledState.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Sku.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Sku.java new file mode 100644 index 0000000000000..6fffae0d3c1c2 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Sku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The pricing tier of the web application firewall policy. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * Name of the pricing tier. + */ + @JsonProperty(value = "name") + private SkuName name; + + /** + * Get the name property: Name of the pricing tier. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: Name of the pricing tier. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SkuName.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SkuName.java new file mode 100644 index 0000000000000..2db720f56e3cb --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/SkuName.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Classic_AzureFrontDoor for SkuName. */ + public static final SkuName CLASSIC_AZURE_FRONT_DOOR = fromString("Classic_AzureFrontDoor"); + + /** 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"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @return known SkuName values. */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/State.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/State.java new file mode 100644 index 0000000000000..c2d8f95e5bde1 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/State.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for State. */ +public final class State extends ExpandableStringEnum { + /** Static value Enabled for State. */ + public static final State ENABLED = fromString("Enabled"); + + /** Static value Disabled for State. */ + public static final State DISABLED = fromString("Disabled"); + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** @return known State values. */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Timeseries.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Timeseries.java new file mode 100644 index 0000000000000..98a9fc05259f7 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Timeseries.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.resourcemanager.frontdoor.fluent.models.TimeseriesInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Timeseries. */ +public interface Timeseries { + /** + * 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 endpoint property: The endpoint associated with the Timeseries data point. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Gets the startDateTimeUtc property: The start DateTime of the Timeseries in UTC. + * + * @return the startDateTimeUtc value. + */ + String startDateTimeUtc(); + + /** + * Gets the endDateTimeUtc property: The end DateTime of the Timeseries in UTC. + * + * @return the endDateTimeUtc value. + */ + String endDateTimeUtc(); + + /** + * Gets the aggregationInterval property: The aggregation interval of the Timeseries. + * + * @return the aggregationInterval value. + */ + AggregationInterval aggregationInterval(); + + /** + * Gets the timeseriesType property: The type of Timeseries. + * + * @return the timeseriesType value. + */ + TimeseriesType timeseriesType(); + + /** + * Gets the country property: The country associated with the Timeseries. Values are country ISO codes as specified + * here- https://www.iso.org/iso-3166-country-codes.html. + * + * @return the country value. + */ + String country(); + + /** + * Gets the timeseriesData property: The set of data points for the timeseries. + * + * @return the timeseriesData value. + */ + List timeseriesData(); + + /** + * Gets the inner com.azure.resourcemanager.frontdoor.fluent.models.TimeseriesInner object. + * + * @return the inner object. + */ + TimeseriesInner innerModel(); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesAggregationInterval.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesAggregationInterval.java new file mode 100644 index 0000000000000..ba3f2f4b5d9ba --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesAggregationInterval.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TimeseriesAggregationInterval. */ +public final class TimeseriesAggregationInterval extends ExpandableStringEnum { + /** Static value Hourly for TimeseriesAggregationInterval. */ + public static final TimeseriesAggregationInterval HOURLY = fromString("Hourly"); + + /** Static value Daily for TimeseriesAggregationInterval. */ + public static final TimeseriesAggregationInterval DAILY = fromString("Daily"); + + /** + * Creates or finds a TimeseriesAggregationInterval from its string representation. + * + * @param name a name to look for. + * @return the corresponding TimeseriesAggregationInterval. + */ + @JsonCreator + public static TimeseriesAggregationInterval fromString(String name) { + return fromString(name, TimeseriesAggregationInterval.class); + } + + /** @return known TimeseriesAggregationInterval values. */ + public static Collection values() { + return values(TimeseriesAggregationInterval.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesDataPoint.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesDataPoint.java new file mode 100644 index 0000000000000..c54dd96f0a0a7 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesDataPoint.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines a timeseries datapoint used in a timeseries. */ +@Fluent +public final class TimeseriesDataPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeseriesDataPoint.class); + + /* + * The DateTime of the Timeseries data point in UTC + */ + @JsonProperty(value = "dateTimeUTC") + private String dateTimeUtc; + + /* + * The Value of the Timeseries data point + */ + @JsonProperty(value = "value") + private Float value; + + /** + * Get the dateTimeUtc property: The DateTime of the Timeseries data point in UTC. + * + * @return the dateTimeUtc value. + */ + public String dateTimeUtc() { + return this.dateTimeUtc; + } + + /** + * Set the dateTimeUtc property: The DateTime of the Timeseries data point in UTC. + * + * @param dateTimeUtc the dateTimeUtc value to set. + * @return the TimeseriesDataPoint object itself. + */ + public TimeseriesDataPoint withDateTimeUtc(String dateTimeUtc) { + this.dateTimeUtc = dateTimeUtc; + return this; + } + + /** + * Get the value property: The Value of the Timeseries data point. + * + * @return the value value. + */ + public Float value() { + return this.value; + } + + /** + * Set the value property: The Value of the Timeseries data point. + * + * @param value the value value to set. + * @return the TimeseriesDataPoint object itself. + */ + public TimeseriesDataPoint withValue(Float value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesType.java new file mode 100644 index 0000000000000..7109b1e085507 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TimeseriesType.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TimeseriesType. */ +public final class TimeseriesType extends ExpandableStringEnum { + /** Static value MeasurementCounts for TimeseriesType. */ + public static final TimeseriesType MEASUREMENT_COUNTS = fromString("MeasurementCounts"); + + /** Static value LatencyP50 for TimeseriesType. */ + public static final TimeseriesType LATENCY_P50 = fromString("LatencyP50"); + + /** Static value LatencyP75 for TimeseriesType. */ + public static final TimeseriesType LATENCY_P75 = fromString("LatencyP75"); + + /** Static value LatencyP95 for TimeseriesType. */ + public static final TimeseriesType LATENCY_P95 = fromString("LatencyP95"); + + /** + * Creates or finds a TimeseriesType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TimeseriesType. + */ + @JsonCreator + public static TimeseriesType fromString(String name) { + return fromString(name, TimeseriesType.class); + } + + /** @return known TimeseriesType values. */ + public static Collection values() { + return values(TimeseriesType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Transform.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Transform.java new file mode 100644 index 0000000000000..76985ee8fee7b --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/Transform.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.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Transform. */ +public final class Transform extends ExpandableStringEnum { + /** Static value Lowercase for Transform. */ + public static final Transform LOWERCASE = fromString("Lowercase"); + + /** Static value Uppercase for Transform. */ + public static final Transform UPPERCASE = fromString("Uppercase"); + + /** Static value Trim for Transform. */ + public static final Transform TRIM = fromString("Trim"); + + /** Static value UrlDecode for Transform. */ + public static final Transform URL_DECODE = fromString("UrlDecode"); + + /** Static value UrlEncode for Transform. */ + public static final Transform URL_ENCODE = fromString("UrlEncode"); + + /** Static value RemoveNulls for Transform. */ + public static final Transform REMOVE_NULLS = fromString("RemoveNulls"); + + /** + * Creates or finds a Transform from its string representation. + * + * @param name a name to look for. + * @return the corresponding Transform. + */ + @JsonCreator + public static Transform fromString(String name) { + return fromString(name, Transform.class); + } + + /** @return known Transform values. */ + public static Collection values() { + return values(Transform.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TransformType.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TransformType.java new file mode 100644 index 0000000000000..d9fb864a09444 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/TransformType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TransformType. */ +public final class TransformType extends ExpandableStringEnum { + /** Static value Lowercase for TransformType. */ + public static final TransformType LOWERCASE = fromString("Lowercase"); + + /** Static value Uppercase for TransformType. */ + public static final TransformType UPPERCASE = fromString("Uppercase"); + + /** Static value Trim for TransformType. */ + public static final TransformType TRIM = fromString("Trim"); + + /** Static value UrlDecode for TransformType. */ + public static final TransformType URL_DECODE = fromString("UrlDecode"); + + /** Static value UrlEncode for TransformType. */ + public static final TransformType URL_ENCODE = fromString("UrlEncode"); + + /** Static value RemoveNulls for TransformType. */ + public static final TransformType REMOVE_NULLS = fromString("RemoveNulls"); + + /** + * Creates or finds a TransformType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransformType. + */ + @JsonCreator + public static TransformType fromString(String name) { + return fromString(name, TransformType.class); + } + + /** @return known TransformType values. */ + public static Collection values() { + return values(TransformType.class); + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ValidateCustomDomainInput.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ValidateCustomDomainInput.java new file mode 100644 index 0000000000000..85b9731248c7f --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ValidateCustomDomainInput.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of the custom domain to be validated for DNS mapping. */ +@Fluent +public final class ValidateCustomDomainInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateCustomDomainInput.class); + + /* + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the ValidateCustomDomainInput object itself. + */ + public ValidateCustomDomainInput withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hostname in model ValidateCustomDomainInput")); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ValidateCustomDomainOutput.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ValidateCustomDomainOutput.java new file mode 100644 index 0000000000000..d8c076878add1 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/ValidateCustomDomainOutput.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.resourcemanager.frontdoor.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.frontdoor.fluent.models.ValidateCustomDomainOutputInner object. + * + * @return the inner object. + */ + ValidateCustomDomainOutputInner innerModel(); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/WebApplicationFirewallPolicy.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/WebApplicationFirewallPolicy.java new file mode 100644 index 0000000000000..f1d7cbb0cb2c2 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/WebApplicationFirewallPolicy.java @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.frontdoor.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.frontdoor.fluent.models.WebApplicationFirewallPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of WebApplicationFirewallPolicy. */ +public interface WebApplicationFirewallPolicy { + /** + * 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 of web application firewall policy. Defaults to Classic_AzureFrontDoor if + * not specified. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the policySettings property: Describes settings for the policy. + * + * @return the policySettings value. + */ + PolicySettings policySettings(); + + /** + * 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 frontendEndpointLinks property: Describes Frontend Endpoints associated with this Web Application + * Firewall policy. + * + * @return the frontendEndpointLinks value. + */ + List frontendEndpointLinks(); + + /** + * Gets the routingRuleLinks property: Describes Routing Rules associated with this Web Application Firewall policy. + * + * @return the routingRuleLinks value. + */ + List routingRuleLinks(); + + /** + * Gets the securityPolicyLinks property: Describes Security Policy associated with this Web Application Firewall + * policy. + * + * @return the securityPolicyLinks value. + */ + List securityPolicyLinks(); + + /** + * Gets the provisioningState property: Provisioning state of the policy. + * + * @return the provisioningState value. + */ + String 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 inner com.azure.resourcemanager.frontdoor.fluent.models.WebApplicationFirewallPolicyInner object. + * + * @return the inner object. + */ + WebApplicationFirewallPolicyInner innerModel(); + + /** The entirety of the WebApplicationFirewallPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The WebApplicationFirewallPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the WebApplicationFirewallPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the WebApplicationFirewallPolicy 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 WebApplicationFirewallPolicy 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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the WebApplicationFirewallPolicy 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.WithSku, + DefinitionStages.WithPolicySettings, + DefinitionStages.WithCustomRules, + DefinitionStages.WithManagedRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + WebApplicationFirewallPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WebApplicationFirewallPolicy create(Context context); + } + /** The stage of the WebApplicationFirewallPolicy 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 WebApplicationFirewallPolicy 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 WebApplicationFirewallPolicy definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The pricing tier of web application firewall policy. Defaults to + * Classic_AzureFrontDoor if not specified.. + * + * @param sku The pricing tier of web application firewall policy. Defaults to Classic_AzureFrontDoor if not + * specified. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the WebApplicationFirewallPolicy definition allowing to specify policySettings. */ + interface WithPolicySettings { + /** + * Specifies the policySettings property: Describes settings for the policy.. + * + * @param policySettings Describes settings for the policy. + * @return the next definition stage. + */ + WithCreate withPolicySettings(PolicySettings policySettings); + } + /** The stage of the WebApplicationFirewallPolicy 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 WebApplicationFirewallPolicy definition allowing to specify managedRules. */ + interface WithManagedRules { + /** + * Specifies the managedRules property: Describes managed rules inside the policy.. + * + * @param managedRules Describes managed rules inside the policy. + * @return the next definition stage. + */ + WithCreate withManagedRules(ManagedRuleSetList managedRules); + } + } + /** + * Begins update for the WebApplicationFirewallPolicy resource. + * + * @return the stage of resource update. + */ + WebApplicationFirewallPolicy.Update update(); + + /** The template for WebApplicationFirewallPolicy update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithEtag, + UpdateStages.WithSku, + UpdateStages.WithPolicySettings, + UpdateStages.WithCustomRules, + UpdateStages.WithManagedRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WebApplicationFirewallPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WebApplicationFirewallPolicy apply(Context context); + } + /** The WebApplicationFirewallPolicy update stages. */ + interface UpdateStages { + /** The stage of the WebApplicationFirewallPolicy update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the WebApplicationFirewallPolicy update 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. + */ + Update withEtag(String etag); + } + /** The stage of the WebApplicationFirewallPolicy update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The pricing tier of web application firewall policy. Defaults to + * Classic_AzureFrontDoor if not specified.. + * + * @param sku The pricing tier of web application firewall policy. Defaults to Classic_AzureFrontDoor if not + * specified. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the WebApplicationFirewallPolicy update allowing to specify policySettings. */ + interface WithPolicySettings { + /** + * Specifies the policySettings property: Describes settings for the policy.. + * + * @param policySettings Describes settings for the policy. + * @return the next definition stage. + */ + Update withPolicySettings(PolicySettings policySettings); + } + /** The stage of the WebApplicationFirewallPolicy update 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. + */ + Update withCustomRules(CustomRuleList customRules); + } + /** The stage of the WebApplicationFirewallPolicy update 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. + */ + Update withManagedRules(ManagedRuleSetList managedRules); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WebApplicationFirewallPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WebApplicationFirewallPolicy refresh(Context context); +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/WebApplicationFirewallPolicyList.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/WebApplicationFirewallPolicyList.java new file mode 100644 index 0000000000000..1f79f6b594462 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/WebApplicationFirewallPolicyList.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.frontdoor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.frontdoor.fluent.models.WebApplicationFirewallPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Defines a list of WebApplicationFirewallPolicies. It contains a list of WebApplicationFirewallPolicy objects and a + * URL link to get the next set of results. + */ +@Fluent +public final class WebApplicationFirewallPolicyList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPolicyList.class); + + /* + * List of WebApplicationFirewallPolicies within a resource group. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of WebApplicationFirewallPolicy objects if there + * are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of 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 WebApplicationFirewallPolicyList object itself. + */ + public WebApplicationFirewallPolicyList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/package-info.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/package-info.java new file mode 100644 index 0000000000000..2a3f07edecc72 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for FrontDoorManagementClient. FrontDoor Client. */ +package com.azure.resourcemanager.frontdoor.models; diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/package-info.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/package-info.java new file mode 100644 index 0000000000000..8681f6732fa31 --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for FrontDoorManagementClient. FrontDoor Client. */ +package com.azure.resourcemanager.frontdoor; diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/module-info.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/module-info.java new file mode 100644 index 0000000000000..8d20f42aafede --- /dev/null +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.frontdoor { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.frontdoor; + exports com.azure.resourcemanager.frontdoor.fluent; + exports com.azure.resourcemanager.frontdoor.fluent.models; + exports com.azure.resourcemanager.frontdoor.models; + + opens com.azure.resourcemanager.frontdoor.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.frontdoor.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/frontdoor/ci.yml b/sdk/frontdoor/ci.yml new file mode 100644 index 0000000000000..9b56660f0bb30 --- /dev/null +++ b/sdk/frontdoor/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: frontdoor + Artifacts: + - name: azure-resourcemanager-frontdoor + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerfrontdoor diff --git a/sdk/frontdoor/pom.xml b/sdk/frontdoor/pom.xml new file mode 100644 index 0000000000000..ee57ce8205d49 --- /dev/null +++ b/sdk/frontdoor/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-frontdoor-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-frontdoor + + + +